Update to commit d9e45a19b61c54bc804232fdc67485b84c7af8e9 dated May 21, 2020. These...
[inform.git] / src / memory.c
index fc8a446f1c7d83219231d063054be2d2bd8b5024..21dcf57efc10b500d9e95cd0f2988d0dcd2a5e37 100644 (file)
@@ -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);