| 1 | /* $Id: malloc.h,v 1.1.1.1 2003/07/02 13:56:58 eleph Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Header file for simple ring 0 OS/2 heap
|
|---|
| 4 | *
|
|---|
| 5 | * (C) 2000-2002 InnoTek Systemberatung GmbH
|
|---|
| 6 | *
|
|---|
| 7 | * This program is free software; you can redistribute it and/or
|
|---|
| 8 | * modify it under the terms of the GNU General Public License as
|
|---|
| 9 | * published by the Free Software Foundation; either version 2 of
|
|---|
| 10 | * the License, or (at your option) any later version.
|
|---|
| 11 | *
|
|---|
| 12 | * This program is distributed in the hope that it will be useful,
|
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 15 | * GNU General Public License for more details.
|
|---|
| 16 | *
|
|---|
| 17 | * You should have received a copy of the GNU General Public
|
|---|
| 18 | * License along with this program; if not, write to the Free
|
|---|
| 19 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
|---|
| 20 | * USA.
|
|---|
| 21 | *
|
|---|
| 22 | */
|
|---|
| 23 |
|
|---|
| 24 | #ifndef MALLOC_INCLUDED
|
|---|
| 25 | #define MALLOC_INCLUDED
|
|---|
| 26 |
|
|---|
| 27 | #define DEFAULT_HEAP 256*1024
|
|---|
| 28 | #define HEAP_SIZE 256*1024
|
|---|
| 29 |
|
|---|
| 30 | // Standard malloc.h functions
|
|---|
| 31 |
|
|---|
| 32 | //NOTE: enabling this in the non-KEE driver causes problems (file name strings
|
|---|
| 33 | // put in seperate private segments)
|
|---|
| 34 | #ifdef DEBUGHEAP
|
|---|
| 35 | void NEAR *malloc(ULONG size, const char *filename, int lineno);
|
|---|
| 36 | void free(void *NEAR ptr, const char *filename, int lineno);
|
|---|
| 37 | void NEAR *realloc(void *NEAR ptr, unsigned long newsize, const char *filename, int lineno);
|
|---|
| 38 | #else
|
|---|
| 39 | void NEAR *malloc(ULONG size);
|
|---|
| 40 | void free(void NEAR *);
|
|---|
| 41 | void NEAR *realloc(void NEAR *, unsigned long);
|
|---|
| 42 | #endif
|
|---|
| 43 |
|
|---|
| 44 | unsigned _msize(void NEAR *);
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | // // Traditional 'C' library memset() -- don't need, intrinsic function !!!
|
|---|
| 48 | // PVOID memset ( PVOID p, int c, USHORT len );
|
|---|
| 49 |
|
|---|
| 50 | // Some extensions
|
|---|
| 51 | unsigned _memfree(void); // returns available space
|
|---|
| 52 |
|
|---|
| 53 | // Specialized routines
|
|---|
| 54 | ULONG HeapInit(ULONG size); // initializes the heap manager
|
|---|
| 55 | void dumpheap(void);
|
|---|
| 56 |
|
|---|
| 57 | BOOL IsHeapAddr(ULONG addr);
|
|---|
| 58 |
|
|---|
| 59 | #endif
|
|---|