]> granicus.if.org Git - python/commitdiff
Document the purpose of the struct _block members.
authorTim Peters <tim.peters@gmail.com>
Thu, 2 Mar 2006 21:41:18 +0000 (21:41 +0000)
committerTim Peters <tim.peters@gmail.com>
Thu, 2 Mar 2006 21:41:18 +0000 (21:41 +0000)
Python/pyarena.c

index 33261b4314856d2b04627232ed95860e8b7d984e..242ca1d67da604518c8c5a9d257b08fa47bd60c4 100644 (file)
@@ -1,7 +1,7 @@
 #include "Python.h"
 #include "pyarena.h"
 
-/* A simple arena block structure
+/* A simple arena block structure.
 
    Measurements with standard library modules suggest the average
    allocation is about 20 bytes and that most compiles use a single
 
 #define DEFAULT_BLOCK_SIZE 8192
 typedef struct _block {
+       /* Total number of bytes owned by this block available to pass out.
+        * Read-only after initialization.  The first such byte starts at
+        * ab_mem.
+        */
        size_t ab_size;
+
+       /* Total number of bytes already passed out.  The next byte available
+        * to pass out starts at ab_mem + ab_offset.
+        */
        size_t ab_offset;
+
+       /* An arena maintains a singly-linked, NULL-terminated list of
+        * all blocks owned by the arena.  These are linked via the
+        * ab_next member.
+        */
        struct _block *ab_next;
+
+       /* Pointer to the first allocatable byte owned by this block.  Read-
+        * only after initialization.
+        */
        void *ab_mem;
 } block;