Mercurial > repos > rhope
diff runtime/fixed_alloc.c @ 92:e73a93fb5de1
Beginning of port of compiler to itself, some bugfixes and a refcount optimization
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 02 Aug 2010 00:58:55 -0400 |
parents | 5a195ee08eac |
children | 43cc42df26cc |
line wrap: on
line diff
--- a/runtime/fixed_alloc.c Sat Jul 31 17:17:23 2010 -0400 +++ b/runtime/fixed_alloc.c Mon Aug 02 00:58:55 2010 -0400 @@ -3,12 +3,12 @@ #include <string.h> #include <stdio.h> -uint16_t max_free[(MAX_SIZE-MIN_SIZE)/STRIDE]; +uint16_t max_free[(MAX_SIZE-MIN_SIZE)/STRIDE+1]; void fixed_alloc_init() { int i; - for(i = 0; i < (MAX_SIZE-MIN_SIZE)/STRIDE; ++i) + for(i = 0; i < ((MAX_SIZE-MIN_SIZE)/STRIDE+1); ++i) max_free[i] = (BLOCK_SIZE - sizeof(mem_block)+1)*8/((i*STRIDE+MIN_SIZE)*8+1); }