Last change
on this file since 49 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
713 bytes
|
Rev | Line | |
---|
[49] | 1 | #ifndef __jmalloc_hpp_ |
---|
| 2 | #define __jmalloc_hpp_ |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | #include <stdlib.h> |
---|
| 6 | |
---|
| 7 | #ifdef MANAGE_MEM |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | #ifdef MEM_CHECK |
---|
| 11 | #include <stdlib.h> |
---|
| 12 | extern void *operator new( size_t size, char *file, unsigned long line); |
---|
| 13 | #define new new(__FILE__,__LINE__) |
---|
| 14 | #endif |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | enum {ALLOC_SPACE_STATIC,ALLOC_SPACE_CACHE}; |
---|
| 18 | extern int alloc_space; |
---|
| 19 | void *jmalloc(long size, char *what_for); |
---|
| 20 | void *jrealloc(void *ptr, long size, char *what_for); |
---|
| 21 | void jfree(void *ptr); |
---|
| 22 | void mem_report(char *filename); |
---|
| 23 | void jmalloc_init(long min_size); |
---|
| 24 | void jmalloc_uninit(); |
---|
| 25 | long j_allocated(); |
---|
| 26 | long j_available(); |
---|
| 27 | extern void free_up_memory(); |
---|
| 28 | #else |
---|
| 29 | #define jmalloc(x,y) malloc(x) |
---|
| 30 | #define jrealloc(x,y,z) realloc(x,y) |
---|
| 31 | #define jfree(x) free(x) |
---|
| 32 | #endif |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | #endif |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
Note: See
TracBrowser
for help on using the repository browser.