| 1 | /* @(#) pf_mem.h 98/01/26 1.3 */ |
| 2 | #ifndef _pf_mem_h |
| 3 | #define _pf_mem_h |
| 4 | |
| 5 | /*************************************************************** |
| 6 | ** Include file for PForth Fake Memory Allocator |
| 7 | ** |
| 8 | ** Author: Phil Burk |
| 9 | ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom |
| 10 | ** |
| 11 | ** The pForth software code is dedicated to the public domain, |
| 12 | ** and any third party may reproduce, distribute and modify |
| 13 | ** code is provided on an "as is" basis without any warranty |
| 14 | ** of any kind, including, without limitation, the implied |
| 15 | ** warranties of merchantability and fitness for a particular |
| 16 | ***************************************************************/ |
| 17 | |
| 18 | #ifdef PF_NO_MALLOC |
| 19 | |
| 20 | #ifdef __cplusplus |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | |
| 24 | void pfInitMemoryAllocator( void ); |
| 25 | char *pfAllocMem( cell_t NumBytes ); |
| 26 | void pfFreeMem( void *Mem ); |
| 27 | |
| 28 | #ifdef __cplusplus |
| 29 | } |
| 30 | #endif |
| 31 | |
| 32 | #else |
| 33 | |
| 34 | #ifdef PF_USER_MALLOC |
| 35 | /* Get user prototypes or macros from include file. |
| 36 | ** API must match that defined above for the stubs. |
| 37 | */ |
| 38 | #include PF_USER_MALLOC |
| 39 | #else |
| 40 | #define pfInitMemoryAllocator() |
| 41 | #define pfAllocMem malloc |
| 42 | #define pfFreeMem free |
| 43 | #endif |
| 44 | |
| 45 | #endif /* PF_NO_MALLOC */ |
| 46 | |
| 47 | #endif /* _pf_mem_h */ |