- // Verify that the object hasn't been freed incorrectly:
- if(r.ref.ptr.obj->type == T_GCFREED) *(int*)0=0; // DEBUG
-
- r.ref.ptr.obj->mark = 1;
- switch(r.ref.ptr.obj->type) {
- case T_VEC:
- if(r.ref.ptr.vec->rec)
- for(i=0; i<r.ref.ptr.vec->rec->size; i++)
- mark(r.ref.ptr.vec->rec->array[i]);
- break;
- case T_HASH:
- if(r.ref.ptr.hash->rec != 0) {
- struct HashRec* hr = r.ref.ptr.hash->rec;
- for(i=0; i < (1<<hr->lgalloced); i++) {
- struct HashNode* hn = hr->table[i];
- while(hn) {
- mark(hn->key);
- mark(hn->val);
- hn = hn->next;
- }
- }
- }
- break;
+ PTR(r).obj->mark = 1;
+ switch(PTR(r).obj->type) {
+ case T_VEC: markvec(r); break;
+ case T_HASH: naiGCMarkHash(r); break;