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: svalue.h,v 1.53 2000/04/19 17:31:21 grubba Exp $ +  * $Id: svalue.h,v 1.54 2000/06/09 22:46:21 mast Exp $    */   #ifndef SVALUE_H   #define SVALUE_H
256:   extern void describe(void *); /* defined in gc.c */   #define check_type(T) if(T > MAX_TYPE && T!=T_LVALUE && T!=T_SHORT_LVALUE && T!=T_VOID && T!=T_DELETED && T!=T_ARRAY_LVALUE) fatal("Type error: %d\n",T)    + #define check_svalue(S) debug_check_svalue(debug_malloc_pass(&(struct svalue) *(S))) +    #define check_refs(S) do {\    if((S)->type <= MAX_REF_TYPE && (!(S)->u.refs || (S)->u.refs[0] < 0)) { \    describe((S)->u.refs); \
277:      #else    + #define check_svalue(S)   #define check_type(T)   #define check_refs(S)   #define check_refs2(S,T)
348:    INT32 num,    struct processing *p);   void check_short_svalue(union anything *u, TYPE_T type); - void check_svalue(struct svalue *s); - TYPE_FIELD real_gc_check_svalues(struct svalue *s, int num); + void debug_check_svalue(struct svalue *s);   void real_gc_xmark_svalues(struct svalue *s, int num); -  + TYPE_FIELD real_gc_check_svalues(struct svalue *s, int num);   void real_gc_check_short_svalue(union anything *u, TYPE_T type); - void debug_gc_mark_svalues(struct svalue *s, int num); - void debug_gc_mark_short_svalue(union anything *u, TYPE_T type); + TYPE_FIELD gc_check_weak_svalues(struct svalue *s, int num); + void gc_check_weak_short_svalue(union anything *u, TYPE_T type); + void real_gc_mark_svalues(struct svalue *s, int num); + void real_gc_mark_short_svalue(union anything *u, TYPE_T type); + TYPE_FIELD gc_mark_weak_svalues(struct svalue *s, int num); + int gc_mark_weak_short_svalue(union anything *u, TYPE_T type); + void real_gc_cycle_check_svalues(struct svalue *s, int num); + void real_gc_cycle_check_short_svalue(union anything *u, TYPE_T type); + TYPE_FIELD gc_cycle_check_weak_svalues(struct svalue *s, int num); + int gc_cycle_check_weak_short_svalue(union anything *u, TYPE_T type);   INT32 pike_sizeof(struct svalue *s);   /* Prototypes end here */    - #define gc_mark_svalues(S,N) debug_gc_mark_svalues(debug_malloc_pass(S),N) - #define gc_mark_short_svalue(U,N) debug_gc_mark_short_svalue(debug_malloc_pass(U),N) + #define gc_xmark_svalues(S,N) real_gc_xmark_svalues(debug_malloc_pass(&(struct svalue) *(S)),N) + #define gc_check_svalues(S,N) real_gc_check_svalues(debug_malloc_pass(&(struct svalue) *(S)),N) + #define gc_check_short_svalue(U,T) real_gc_check_short_svalue(debug_malloc_pass(&(union anything) *(U)),T) + #define gc_mark_svalues(S,N) real_gc_mark_svalues(debug_malloc_pass(&(struct svalue) *(S)),N) + #define gc_mark_short_svalue(U,T) real_gc_mark_short_svalue(debug_malloc_pass(&(union anything) *(U)),T) + #define gc_cycle_check_svalues(S,N) real_gc_cycle_check_svalues(debug_malloc_pass(&(struct svalue) *(S)),N) + #define gc_cycle_check_short_svalue(U,T) real_gc_cycle_check_short_svalue(debug_malloc_pass(&(union anything) *(U)),T)      #ifndef NO_PIKE_SHORTHAND