>From 5ecae6a4548339313927ccfe0ef16e7320d5065e Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 25 Mar 2013 20:49:30 +0100 Subject: [PATCH] 623c46bea299fa8fb2e5702661a8e3def1016984 didn't make CHICKEN_initialize's "initial heap size" argument a size_t. This fixes that (thanks to Andrei Barbu) --- NEWS | 2 ++ chicken.h | 2 +- runtime.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index a34fbe0..f886245 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,8 @@ - C API - Deprecated C_get_argument[_2] and C_get_environment_variable[_2] functions. + - CHICKEN_initialize now accepts a size_t for its initial heap size, + allowing it to exceed 4GB on 64-bit systems (thanks to Andrei Barbu). 4.8.1 diff --git a/chicken.h b/chicken.h index 2b9030a..6d8a2fe 100644 --- a/chicken.h +++ b/chicken.h @@ -1627,7 +1627,7 @@ C_varextern C_TLS C_word (*C_get_unbound_variable_value_hook)(C_word sym); C_BEGIN_C_DECLS C_fctexport int CHICKEN_main(int argc, char *argv[], void *toplevel); -C_fctexport int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel); +C_fctexport int CHICKEN_initialize(size_t heap, int stack, int symbols, void *toplevel); C_fctexport C_word CHICKEN_run(void *toplevel); C_fctexport C_word CHICKEN_continue(C_word k); C_fctexport void *CHICKEN_new_gc_root(); diff --git a/runtime.c b/runtime.c index 099dbdc..e46fb6a 100644 --- a/runtime.c +++ b/runtime.c @@ -600,7 +600,7 @@ void parse_argv(C_char *cmds) /* Initialize runtime system: */ -int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel) +int CHICKEN_initialize(size_t heap, int stack, int symbols, void *toplevel) { int i; #ifdef HAVE_SIGACTION @@ -1151,7 +1151,7 @@ void C_set_or_change_heap_size(C_word heap, int reintern) if(fromspace_start && heap_size >= heap) return; if(debug_mode) - C_dbg(C_text("debug"), C_text("heap resized to %d bytes\n"), (int)heap); + C_dbg(C_text("debug"), C_text("heap resized to %zu bytes\n"), heap); heap_size = heap; -- 1.8.0.1