mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
runtime fixes, byterun fixes
This commit is contained in:
parent
233fa95e14
commit
e456304eb3
11 changed files with 513 additions and 411 deletions
|
|
@ -63,7 +63,7 @@ void *alloc (size_t size) {
|
|||
size = BYTES_TO_WORDS(size);
|
||||
size_t padding = size * sizeof(size_t) - obj_size;
|
||||
#if defined(DEBUG_VERSION) && defined(DEBUG_PRINT)
|
||||
fprintf(stderr, "allocation of size %zu words (%zu bytes): ", size, bytes_sz);
|
||||
fprintf(stderr, "allocation of size %zu words (%zu bytes): ", size, padding);
|
||||
#endif
|
||||
void *p = gc_alloc_on_existing_heap(size);
|
||||
if (!p) {
|
||||
|
|
|
|||
|
|
@ -15,11 +15,9 @@ extern size_t __gc_stack_top, __gc_stack_bottom;
|
|||
flag = __gc_stack_top == 0; \
|
||||
if (flag) { __gc_stack_top = (size_t)__builtin_frame_address(0); } \
|
||||
assert(__gc_stack_top != 0); \
|
||||
assert((__gc_stack_top & 0xF) == 0); \
|
||||
assert(__builtin_frame_address(0) <= (void *)__gc_stack_top);
|
||||
assert((__gc_stack_top & 0x7) == 0);
|
||||
|
||||
#define POST_GC() \
|
||||
assert(__builtin_frame_address(0) <= (void *)__gc_stack_top); \
|
||||
if (flag) { __gc_stack_top = 0; }
|
||||
|
||||
_Noreturn static void vfailure (char *s, va_list args) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue