X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fcoreparse.c;h=17574443c010e9a24c3b44c5a60f85ec2b8c5a2f;hb=371577a214ce2659c271279ad48e4c42e1c0c93e;hp=e8a513bbe0caecf04e53de3a83f1e0a0dc2406db;hpb=afcfb8b5da57ffc36f9029e0962cc64ba2318484;p=sbcl.git diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index e8a513b..1757444 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -83,12 +83,16 @@ read_runtime_options(int fd) void maybe_initialize_runtime_options(int fd) { + struct runtime_options *new_runtime_options; off_t end_offset = sizeof(lispobj) + sizeof(os_vm_offset_t) + (RUNTIME_OPTIONS_WORDS * sizeof(size_t)); lseek(fd, -end_offset, SEEK_END); - runtime_options = read_runtime_options(fd); + + if (new_runtime_options = read_runtime_options(fd)) { + runtime_options = new_runtime_options; + } } /* Search 'filename' for an embedded core. An SBCL core has, at the @@ -419,6 +423,7 @@ load_core_file(char *file, os_vm_offset_t file_offset) size_t offset = 0; long bytes_read; unsigned long data[4096]; + unsigned long word; lseek(fd, fdoffset + file_offset, SEEK_SET); while ((bytes_read = read(fd, data, (size < 4096 ? size : 4096 ))) > 0) @@ -431,9 +436,12 @@ load_core_file(char *file, os_vm_offset_t file_offset) * core entry was rounded up to os_vm_page_size * during the save, and might now have more * elements than the page table. + * + * The low bits of each word are allocation flags. */ - if (data[i]) { - page_table[offset].region_start_offset = data[i]; + if (word=data[i]) { + page_table[offset].region_start_offset = word & ~0x03; + page_table[offset].allocated = word & 0x03; } i++; offset++;