Merge pull request #809 from dpapavas/use-malloc

Build fails with SEXP_USE_MALLOC
This commit is contained in:
Alex Shinn 2022-01-10 08:01:45 +09:00 committed by GitHub
commit f126c47c3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
gc.c
View file

@ -37,7 +37,7 @@ static sexp_heap sexp_heap_last (sexp_heap h) {
return h;
}
#if !SEXP_USE_FIXED_CHUNK_SIZE_HEAPS
#if !SEXP_USE_FIXED_CHUNK_SIZE_HEAPS && !SEXP_USE_MALLOC
static size_t sexp_heap_total_size (sexp_heap h) {
size_t total_size = 0;
for (; h; h=h->next)
@ -696,6 +696,7 @@ int sexp_find_fixed_chunk_heap_usage(sexp ctx, size_t size, size_t* sum_freed, s
}
#endif
#if ! SEXP_USE_MALLOC
void* sexp_alloc (sexp ctx, size_t size) {
void *res;
size_t max_freed, sum_freed, total_size=0;
@ -741,6 +742,7 @@ void* sexp_alloc (sexp ctx, size_t size) {
#endif
return res;
}
#endif
void sexp_gc_init (void) {