* The gc now knows about bytevectors

This commit is contained in:
Abdulaziz Ghuloum 2007-05-17 04:34:52 -04:00
parent 913bd590b6
commit 5249a8ec31
5 changed files with 19 additions and 1 deletions

Binary file not shown.

View File

@ -1128,6 +1128,18 @@ add_object_proc(gc_t* gc, ikp x)
exit(-1);
}
}
else if(tag == bytevector_tag){
int len = unfix(fst);
int memreq = align(len + disp_bytevector_data + 1);
ikp new_bv = gc_alloc_new_data(memreq, gen, gc) + bytevector_tag;
ref(new_bv, off_bytevector_length) = fst;
memcpy(new_bv+off_bytevector_data,
x + off_bytevector_data,
len + 1);
ref(x, -bytevector_tag) = forward_ptr;
ref(x, wordsize-bytevector_tag) = new_bv;
return new_bv;
}
fprintf(stderr, "unhandled tag: %d\n", tag);
exit(-1);
}

View File

@ -128,6 +128,12 @@
#define off_symbol_unused (disp_symbol_unused - symbol_tag)
#endif
#define bytevector_tag 2
#define disp_bytevector_length 0
#define disp_bytevector_data 4
#define off_bytevector_length (disp_bytevector_length - bytevector_tag)
#define off_bytevector_data (disp_bytevector_data - bytevector_tag)
#define symbol_record_tag ((ikp) 0x5F)
#define disp_symbol_record_string 4
#define disp_symbol_record_ustring 8

Binary file not shown.

View File

@ -628,7 +628,7 @@
[do-overflow ]
[do-overflow-words ]
[do-vararg-overflow ]
[collect ]
[collect i]
[do-stack-overflow ]
[syntax-dispatch ]
))