diff options
author | Tom Schouten <doelie@users.sourceforge.net> | 2006-09-01 13:45:31 +0000 |
---|---|---|
committer | Tom Schouten <doelie@users.sourceforge.net> | 2006-09-01 13:45:31 +0000 |
commit | 7591a024f184bd385d35583d19d86c1d5f2531ba (patch) | |
tree | 77aa0c44ccb700eb9a2b16e1b246e3c8026c40ed /system/kernel/pdp_mem.c | |
parent | 91dd6b68f0f209ad015a303095bb1df018dca71e (diff) |
pdp current darcs merge
svn path=/trunk/externals/pdp/; revision=5816
Diffstat (limited to 'system/kernel/pdp_mem.c')
-rw-r--r-- | system/kernel/pdp_mem.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/system/kernel/pdp_mem.c b/system/kernel/pdp_mem.c index 33822ef..93c7122 100644 --- a/system/kernel/pdp_mem.c +++ b/system/kernel/pdp_mem.c @@ -19,9 +19,14 @@ */ #include <stdlib.h> +#include <stdio.h> #include "pdp_mem.h" #include "pdp_debug.h" +// defined here so we don't need to rebuild when changing it (deps for headers are broken) +#define PDP_FASTALLOC_BLOCK_ELEMENTS 4096 +//#define PDP_FASTALLOC_BLOCK_ELEMENTS 1 +#define D if (0) /* malloc wrapper that calls garbage collector */ void *pdp_alloc(int size) @@ -30,6 +35,8 @@ void *pdp_alloc(int size) PDP_ASSERT(ptr); + D fprintf(stderr, "alloc %p %d\n", ptr, size); + return ptr; //TODO: REPAIR THIS @@ -41,6 +48,7 @@ void *pdp_alloc(int size) void pdp_dealloc(void *stuff) { + D fprintf(stderr, "dealloc %p\n", stuff); free (stuff); } @@ -87,6 +95,10 @@ static void _pdp_fastalloc_refill_freelist(t_pdp_fastalloc *x) } +#define USE_FASTALLOC 1 + +#if USE_FASTALLOC + void *pdp_fastalloc_new_atom(t_pdp_fastalloc *x) { t_fastalloc *atom; @@ -127,3 +139,10 @@ t_pdp_fastalloc *pdp_fastalloc_new(unsigned int size) return x; } +#else + +void *pdp_fastalloc_new_atom(t_pdp_fastalloc *x) {return pdp_alloc(12);} +void pdp_fastalloc_save_atom(t_pdp_fastalloc *x, void *atom) {pdp_dealloc(atom);} +t_pdp_fastalloc *pdp_fastalloc_new(unsigned int size) {return 0;} + +#endif |