mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
heaps allocate an extra cell to be safe (re: issue #10)
This commit is contained in:
parent
ef97713ab7
commit
351bf36ecf
1 changed files with 2 additions and 1 deletions
3
gc.c
3
gc.c
|
@ -171,7 +171,8 @@ sexp sexp_gc (sexp ctx, size_t *sum_freed) {
|
|||
|
||||
sexp_heap sexp_make_heap (size_t size) {
|
||||
sexp_free_list free, next;
|
||||
sexp_heap h = (sexp_heap) malloc(sizeof(struct sexp_heap) + size);
|
||||
sexp_heap h
|
||||
= (sexp_heap) malloc(sizeof(struct sexp_heap) + size + sexp_heap_align(1));
|
||||
if (! h) return NULL;
|
||||
h->size = size;
|
||||
h->data = (char*) sexp_heap_align((sexp_uint_t)&(h->data));
|
||||
|
|
Loading…
Add table
Reference in a new issue