Select Git revision
Forked from
Nettle / nettle
Source project has a limited visibility.
-
Niels Möller authored
Rev: src/nettle/testsuite/rsa-test.c:1.7
Niels Möller authoredRev: src/nettle/testsuite/rsa-test.c:1.7
object.h 3.95 KiB
/*\
||| This file a part of Pike, and is copyright by Fredrik Hubinette
||| Pike is distributed as GPL (General Public License)
||| See the files COPYING and DISCLAIMER for more information.
\*/
/*
* $Id: object.h,v 1.35 1999/11/23 10:36:39 mast Exp $
*/
#ifndef OBJECT_H
#define OBJECT_H
#include "global.h"
#include "svalue.h"
/* a destructed object has no program */
#ifndef STRUCT_OBJECT_DECLARED
#define STRUCT_OBJECT_DECLARED
#endif
struct object
{
INT32 refs; /* Reference count, must be first. */
#ifdef PIKE_SECURITY
struct object *prot;
#endif
struct program *prog;
struct object *parent;
INT16 parent_identifier;
struct object *next;
struct object *prev;
char storage[1];
};
extern struct object *first_object;
extern struct object *master_object;
extern struct program *master_program;
extern struct program *magic_index_program;
extern struct program *magic_set_index_program;
#define free_object(O) do{ struct object *o_=(O); debug_malloc_touch(o_); if(!--o_->refs) really_free_object(o_); }while(0)
#define LOW_GET_GLOBAL(O,I,ID) ((O)->storage+INHERIT_FROM_INT((O)->prog, (I))->storage_offset+(ID)->func.offset)
#define GET_GLOBAL(O,I) LOW_GET_GLOBAL(O,I,ID_FROM_INT((O)->prog,I))
#define GLOBAL_FROM_INT(I) GET_GLOBAL(fp->current_object, I)
#define this_object() (add_ref(fp->current_object), fp->current_object)
#include "block_alloc_h.h"
/* Prototypes begin here */
struct object *low_clone(struct program *p);
void call_c_initializers(struct object *o);
void do_free_object(struct object *o);
struct object *debug_clone_object(struct program *p, int args);
struct object *fast_clone_object(struct program *p, int args);
struct object *parent_clone_object(struct program *p,
struct object *parent,
int parent_identifier,
int args);
struct object *get_master(void);
struct object *debug_master(void);
struct destroy_called_mark;
PTR_HASH_ALLOC(destroy_called_mark,128)
static void call_destroy(struct object *o, int foo);
void low_destruct(struct object *o,int do_free);
void destruct(struct object *o);
void destruct_objects_to_destruct(void);
void really_free_object(struct object *o);
void low_object_index_no_free(struct svalue *to,
struct object *o,