X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fmemory.c;h=21dcf57efc10b500d9e95cd0f2988d0dcd2a5e37;hb=e536ce9e39cc1bfa82ecd1d6d73f874af655f9db;hp=fc8a446f1c7d83219231d063054be2d2bd8b5024;hpb=18379907e684280f6e70bf5c2205c2968e56fa67;p=inform.git diff --git a/src/memory.c b/src/memory.c index fc8a446..21dcf57 100644 --- a/src/memory.c +++ b/src/memory.c @@ -2,7 +2,7 @@ /* "memory" : Memory management and ICL memory setting commands */ /* (For "memoryerror", see "errors.c") */ /* */ -/* Copyright (c) Graham Nelson 1993 - 2018 */ +/* Copyright (c) Graham Nelson 1993 - 2020 */ /* */ /* This file is part of Inform. */ /* */ @@ -170,6 +170,14 @@ extern void my_free(void *pointer, char *whatitwas) /* ------------------------------------------------------------------------- */ /* Extensible blocks of memory, providing a kind of RAM disc as an */ /* alternative to the temporary files option */ +/* */ +/* The allocation is slightly confusing. A block can store up to 72 */ +/* chunks, which are allocated as needed when data is written. (Data does */ +/* not have to be written in order, but you should not try to read a byte */ +/* before writing it.) The size of a chunk is defined by ALLOC_CHUNK_SIZE. */ +/* So any block can store any amount of data, but you increase the limit */ +/* (for all blocks) by increasing ALLOC_CHUNK_SIZE, not the number of */ +/* chunks. */ /* ------------------------------------------------------------------------- */ static char chunk_name_buffer[60]; @@ -179,6 +187,7 @@ static char *chunk_name(memory_block *MB, int no) if (MB == &zcode_area) p = "Z-code area"; if (MB == &link_data_area) p = "link data area"; if (MB == &zcode_backpatch_table) p = "Z-code backpatch table"; + if (MB == &staticarray_backpatch_table) p = "Static array backpatch table"; if (MB == &zmachine_backpatch_table) p = "Z-machine backpatch table"; sprintf(chunk_name_buffer, "%s chunk %d", p, no); return(chunk_name_buffer);