Imported Upstream version 21
[debian/pforth] / csrc / pf_mem.h
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, Devid 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 pfInitMemAllocator( void *addr, uint32 poolSize );
25         char *pfAllocMem( int32 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\r
40                 #define pfAllocMem malloc\r
41                 #define pfFreeMem free
42         #endif
43         
44 #endif /* PF_NO_MALLOC */
45
46 #endif /* _pf_mem_h */