diff --git a/eval.c b/eval.c index c641894b..f4efba99 100644 --- a/eval.c +++ b/eval.c @@ -392,7 +392,7 @@ sexp sexp_make_child_context (sexp ctx, sexp lambda) { sexp_context_stack(ctx), sexp_context_env(ctx), 0, - sexp_context_heap(ctx)->max_size); + sexp_context_max_size(ctx)); if (! sexp_exceptionp(res)) { sexp_context_lambda(res) = lambda; sexp_context_top(res) = sexp_context_top(ctx); diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index 0da16d32..bd7b029a 100644 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -813,9 +813,11 @@ SEXP_API sexp sexp_make_unsigned_integer(sexp ctx, sexp_luint_t x); #if ! SEXP_USE_BOEHM SEXP_API sexp_heap sexp_global_heap; #endif -#define sexp_context_heap(ctx) sexp_global_heap +#define sexp_context_heap(ctx) sexp_global_heap +#define sexp_context_max_size(ctx) 0 #else -#define sexp_context_heap(ctx) ((ctx)->value.context.heap) +#define sexp_context_heap(ctx) ((ctx)->value.context.heap) +#define sexp_context_max_size(ctx) sexp_context_heap(ctx)->max_size #endif #if SEXP_USE_GLOBAL_SYMBOLS