* The gc now knows about bytevectors
This commit is contained in:
parent
913bd590b6
commit
5249a8ec31
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -628,7 +628,7 @@
|
|||
[do-overflow ]
|
||||
[do-overflow-words ]
|
||||
[do-vararg-overflow ]
|
||||
[collect ]
|
||||
[collect i]
|
||||
[do-stack-overflow ]
|
||||
[syntax-dispatch ]
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue