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: mapping.h,v 1.24 2000/04/23 03:01:25 mast Exp $ +  * $Id: mapping.h,v 1.25 2000/06/09 22:43:05 mast Exp $    */   #ifndef MAPPING_H   #define MAPPING_H
51:         extern struct mapping *first_mapping; + extern struct mapping *gc_internal_mapping;      #define map_delete(m,key) map_delete_no_free(m, key, 0)   #define m_sizeof(m) ((m)->data->size)
145:   void check_mapping(struct mapping *m);   void check_all_mappings(void);   void gc_mark_mapping_as_referenced(struct mapping *m); - INT32 gc_touch_all_mappings(void); + unsigned gc_touch_all_mappings(void);   void gc_check_all_mappings(void);   void gc_mark_all_mappings(void); -  + void real_gc_cycle_check_mapping(struct mapping *m); + void real_gc_cycle_check_mapping_weak(struct mapping *m); + void gc_cycle_check_all_mappings(void);   void gc_free_all_unreferenced_mappings(void);   void simple_describe_mapping(struct mapping *m);   void debug_dump_mapping(struct mapping *m);   void zap_all_mappings(void);   /* Prototypes end here */ - #endif +       #define allocate_mapping(X) dmalloc_touch(struct mapping *,debug_allocate_mapping(X))    -  + #define gc_cycle_check_mapping(X) \ +  enqueue_lifo(&gc_mark_queue, (queue_call) real_gc_cycle_check_mapping, (X)) + #define gc_cycle_check_mapping_weak(X) \ +  enqueue_lifo(&gc_mark_queue, (queue_call) real_gc_cycle_check_mapping_weak, (X)) +  + #endif /* MAPPING_H */