]> git.sur5r.net Git - cc65/blobdiff - include/_heap.h
Fixed LinuxDoc Tools issues in some verbatim blocks in the Atari document.
[cc65] / include / _heap.h
index f4019da205fb82d1820d6171a4bd11eb9c65e526..c054cfa34b7ed3e5cf47913b6ea8ce644626e0c1 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * _heap.h
- *
- * Ullrich von Bassewitz, 03.06.1998
- *
- */
+** _heap.h
+**
+** Ullrich von Bassewitz, 1998-06-03, 2004-12-19
+**
+*/
 
 
 
 
 
 
+/* Structure that preceeds a user block in most cases.
+** The aligned_malloc function may generate blocks where the start pointer
+** and size are splitted to handle a memory hole that is needed for
+** alignment.
+*/
+struct usedblock {
+    unsigned            size;
+    struct usedblock*   start;
+};
+
 /* Space needed for administering used blocks */
-#define HEAP_ADMIN_SPACE        sizeof (unsigned)
+#define HEAP_ADMIN_SPACE        sizeof (struct usedblock)
 
 /* The data type used to implement the free list.
- * Beware: Field order is significant!
- */
+** Beware: Field order is significant!
+*/
 struct freeblock {
-    unsigned           size;
-    struct freeblock*          next;
-    struct freeblock*          prev;
+    unsigned            size;
+    struct freeblock*   next;
+    struct freeblock*   prev;
 };
 
 
 
 /* Variables that describe the heap */
-extern unsigned*                 _heaporg;     /* Bottom of heap */
-extern unsigned*         _heapptr;     /* Current top */
-extern unsigned*         _heapend;     /* Upper limit */
-extern struct freeblock*  _heapfirst;  /* First free block in list */
-extern struct freeblock*  _heaplast;   /* Last free block in list */
+extern unsigned*          _heaporg;     /* Bottom of heap */
+extern unsigned*          _heapptr;     /* Current top */
+extern unsigned*          _heapend;     /* Upper limit */
+extern struct freeblock*  _heapfirst;   /* First free block in list */
+extern struct freeblock*  _heaplast;    /* Last free block in list */