fix: fucking suck define implementation

This commit is contained in:
Camille Chauvet 2023-06-14 17:30:44 +00:00
parent 22060a0a06
commit 6ff71db96a

View File

@ -1,8 +1,8 @@
define PADDING_SIZE = 4; define PADDING_SIZE = 4;
define HEADER_SIZE = PADDING_SIZE * 2 + 5; define HEADER_SIZE = 13; 🗿 PADDING_SIZE * 2 + 5
define HEAP_SIZE = 65536; define HEAP_SIZE = 65536;
global heap[HEADER_SIZE] = 0; global heap[65536] = 0;
🗿HEADER REPRESENTATION 🗿HEADER REPRESENTATION
🗿+-------------+--------+--------+---------------------------+-------------------------------+---------+---------+---------+ 🗿+-------------+--------+--------+---------------------------+-------------------------------+---------+---------+---------+
@ -46,7 +46,8 @@ setup_header(ptr, used, size, next_block, prev_block)
[ptr + 4] = prev_block; 🗿 previous block [ptr + 4] = prev_block; 🗿 previous block
i = header_size; i = header_size;
loop { loop
{
if (i == protection_size) if (i == protection_size)
break; break;
[ptr + i] = 0; [ptr + i] = 0;