]> git.sur5r.net Git - cc65/blobdiff - asminc/_heap.inc
rearranged order of new optimizations to better handle -Oi flag
[cc65] / asminc / _heap.inc
index aef77cbf0c4c1a880cb111095ba173d66a9aa6a2..a7d6acea2346ae144402b71a3a58a0088752090c 100644 (file)
@@ -1,21 +1,31 @@
 ;
 ; _heap.inc
 ;
-; (C) Copyright 2003 Ullrich von Bassewitz (uz@cc65.org)
+; (c) Copyright 2003, Ullrich von Bassewitz (uz@cc65.org)
 ;
 
 ; Assembler include file that makes the constants and structures in _heap.h
 ; available for asm code.
 
-HEAP_ADMIN_SPACE        =       2
-HEAP_MIN_BLOCKSIZE      =       6       ; Minimum size of an allocated block
+; Struct freeblock
+; NOTE: For performance reasons, the asm code often uses increment/decrement
+; operators to access other offsets, so just changing offsets here will
+; probably not work.
+.struct freeblock
+        size    .word
+        next    .addr
+        prev    .addr
+.endstruct
 
-; Struct freeblock offsets and size. NOTE: For performance reasons, the asm
-; code often uses increment/decrement operators to access other offsets, so
-; just changing offsets here will probably not work.
-freeblock_size  = 0
-freeblock_next  = 2
-freeblock_prev  = 4
+; Struct usedblock
+; See notes above
+.struct usedblock
+        size    .word
+        start   .addr
+.endstruct
+
+HEAP_MIN_BLOCKSIZE  = .sizeof (freeblock)   ; Minimum size of an allocated block
+HEAP_ADMIN_SPACE    = .sizeof (usedblock)   ; Additional space for used bock
 
 ; Variables
 .global         __heaporg