mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
don't try to create an image for a chunked heap
This commit is contained in:
parent
3e28bdef8b
commit
9a9202716c
1 changed files with 5 additions and 1 deletions
6
main.c
6
main.c
|
@ -170,12 +170,16 @@ static int sexp_save_image (sexp ctx, const char* path) {
|
|||
sexp_heap heap;
|
||||
FILE* file;
|
||||
struct sexp_image_header_t header;
|
||||
heap = sexp_context_heap(ctx);
|
||||
if (heap->next) {
|
||||
fprintf(stderr, "can't save image for a chunked heap, try a larger initial heap with -h\n");
|
||||
return 0;
|
||||
}
|
||||
file = fopen(path, "w");
|
||||
if (!file) {
|
||||
fprintf(stderr, "couldn't open image file for writing: %s\n", path);
|
||||
return 0;
|
||||
}
|
||||
heap = sexp_context_heap(ctx);
|
||||
memcpy(&header.magic, SEXP_IMAGE_MAGIC, sizeof(header.magic));
|
||||
memcpy(&header.abi, SEXP_ABI_IDENTIFIER, sizeof(header.abi));
|
||||
header.major = SEXP_IMAGE_MAJOR_VERSION;
|
||||
|
|
Loading…
Add table
Reference in a new issue