Branch: Tag:

2000-06-09

2000-06-09 22:46:21 by Martin Stjernholm <mast@lysator.liu.se>

GC tries to behave well when destructing objects with destroy functions.
Weak references are handled in a more streamlined way.

Rev: src/array.c:1.73
Rev: src/array.h:1.20
Rev: src/gc.c:1.85
Rev: src/gc.h:1.42
Rev: src/mapping.c:1.84
Rev: src/mapping.h:1.25
Rev: src/multiset.c:1.22
Rev: src/multiset.h:1.11
Rev: src/object.c:1.122
Rev: src/object.h:1.46
Rev: src/program.c:1.240
Rev: src/program.h:1.90
Rev: src/svalue.c:1.74
Rev: src/svalue.h:1.54

5:   \*/      /* -  * $Id: program.h,v 1.89 2000/05/23 21:12:05 hubbe Exp $ +  * $Id: program.h,v 1.90 2000/06/09 22:43:05 mast Exp $    */   #ifndef PROGRAM_H   #define PROGRAM_H
304:   extern int catch_level;   extern INT32 num_used_modules;   extern struct program *pike_trampoline_program; + extern struct program *gc_internal_program;      /* Flags for identifier finding... */   #define SEE_STATIC 1
379:    INT32 flags,    INT32 offset,    INT32 run_time_type); + int quick_map_variable(char *name, +  int name_length, +  INT32 offset, +  char *type, +  int type_length, +  INT32 run_time_type, +  INT32 flags);   int define_variable(struct pike_string *name,    struct pike_string *type,    INT32 flags);
454:   void init_program(void);   void cleanup_program(void);   void gc_mark_program_as_referenced(struct program *p); - INT32 gc_touch_all_programs(void); + unsigned gc_touch_all_programs(void);   void gc_check_all_programs(void);   void gc_mark_all_programs(void); -  + void real_gc_cycle_check_program(struct program *p); + void real_gc_cycle_check_program_weak(struct program *p); + void gc_cycle_check_all_programs(void);   void gc_free_all_unreferenced_programs(void);   void count_memory_in_programs(INT32 *num_, INT32 *size_);   void push_compiler_frame(int lexical_scope);
487:   #define ADD_INT_CONSTANT(NAME,CONST,FLAGS) \    quick_add_integer_constant(NAME,CONSTANT_STRLEN(NAME),CONST,FLAGS)    + #define MAP_VARIABLE(NAME,OFFSET,TYPE,RTTYPE,FLAGS) \ +  quick_map_variable(NAME,CONSTANT_STRLEN(NAME),OFFSET,TYPE,CONSTANT_STRLEN(TYPE),RTTYPE,FLAGS) +    #define ADD_FUNCTION_DTYPE(NAME,FUN,DTYPE,FLAGS) do { \    DTYPE_START; \    {DTYPE} \
507:    new_program->id=PIKE_CONCAT3(PROG_,ID,_ID); \    }while(0)    -  - #endif /* PROGRAM_H */ -  +    #ifdef DEBUG_MALLOC   #define end_program() ((struct program *)debug_malloc_pass(debug_end_program()))   #define end_class(NAME, FLAGS) (debug_malloc_touch(new_program), debug_end_class(NAME, CONSTANT_STRLEN(NAME), FLAGS))
525:   #define start_new_program() debug_start_new_program()   #endif    + #define gc_cycle_check_program(X) \ +  enqueue_lifo(&gc_mark_queue, (queue_call) real_gc_cycle_check_program, (X)) + #define gc_cycle_check_program_weak(X) \ +  enqueue_lifo(&gc_mark_queue, (queue_call) real_gc_cycle_check_program_weak, (X)) +  +  + #endif /* PROGRAM_H */