Update to commit e2647ad952b4d7afc9a186429c181efbc4958786
[inform.git] / src / memory.c
index fc8a446f1c7d83219231d063054be2d2bd8b5024..9b4a6693994ca37d54a323e6401bd1c197297423 100644 (file)
@@ -2,9 +2,8 @@
 /*   "memory" : Memory management and ICL memory setting commands            */
 /*              (For "memoryerror", see "errors.c")                          */
 /*                                                                           */
-/* Copyright (c) Graham Nelson 1993 - 2018                                   */
-/*                                                                           */
-/* This file is part of Inform.                                              */
+/*   Part of Inform 6.35                                                     */
+/*   copyright (c) Graham Nelson 1993 - 2020                                 */
 /*                                                                           */
 /* Inform is free software: you can redistribute it and/or modify            */
 /* it under the terms of the GNU General Public License as published by      */
@@ -17,7 +16,7 @@
 /* GNU General Public License for more details.                              */
 /*                                                                           */
 /* You should have received a copy of the GNU General Public License         */
-/* along with Inform. If not, see https://gnu.org/licenses/                  */
+/* along with Inform. If not, see https://gnu.org/licenses/                  *
 /*                                                                           */
 /* ------------------------------------------------------------------------- */
 
@@ -170,6 +169,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 +186,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);