parent
bc95e906a3
commit
5f7f58ea8a
|
@ -71,11 +71,11 @@ F_ARRAY* resize_array(F_ARRAY* array, CELL capacity, CELL fill)
|
|||
|
||||
void primitive_resize_array(void)
|
||||
{
|
||||
F_ARRAY* array; CELL capacity;
|
||||
maybe_gc(0);
|
||||
F_ARRAY* array;
|
||||
CELL capacity = to_fixnum(dpeek2());
|
||||
maybe_gc(array_size(capacity));
|
||||
array = untag_array_fast(dpop());
|
||||
capacity = to_fixnum(dpop());
|
||||
dpush(tag_object(resize_array(array,capacity,F)));
|
||||
drepl(tag_object(resize_array(array,capacity,F)));
|
||||
}
|
||||
|
||||
void fixup_array(F_ARRAY* array)
|
||||
|
|
|
@ -58,6 +58,11 @@ INLINE CELL dpeek(void)
|
|||
return get(ds);
|
||||
}
|
||||
|
||||
INLINE CELL dpeek2(void)
|
||||
{
|
||||
return get(ds - CELLS);
|
||||
}
|
||||
|
||||
INLINE CELL cpop(void)
|
||||
{
|
||||
CELL value = get(cs);
|
||||
|
|
|
@ -66,11 +66,11 @@ F_STRING* resize_string(F_STRING* string, F_FIXNUM capacity, u16 fill)
|
|||
|
||||
void primitive_resize_string(void)
|
||||
{
|
||||
F_STRING* string; CELL capacity;
|
||||
maybe_gc(0);
|
||||
F_STRING* string;
|
||||
CELL capacity = to_fixnum(dpeek2());
|
||||
maybe_gc(string_size(capacity));
|
||||
string = untag_string_fast(dpop());
|
||||
capacity = to_fixnum(dpop());
|
||||
dpush(tag_object(resize_string(string,capacity,F)));
|
||||
drepl(tag_object(resize_string(string,capacity,F)));
|
||||
}
|
||||
|
||||
F_STRING *memory_to_string(const BYTE* string, CELL length)
|
||||
|
|
Loading…
Reference in New Issue