source: trunk/src/win32k/include/malloc.h@ 847

Last change on this file since 847 was 847, checked in by bird, 26 years ago

Initial checkin of Win32k. (not tested & pe2lx not up-to-date!)

File size: 2.2 KB
Line 
1/* $Id: malloc.h,v 1.1 1999-09-06 02:19:58 bird Exp $
2 *
3 * Heap.
4 *
5 * Note: This heap does very little checking on input.
6 * Use with care! We're running at Ring-0!
7 *
8 * Copyright (c) 1999 knut st. osmundsen
9 *
10 */
11
12/* XLATOFF */
13#ifndef _MALLOC_H_
14#define _MALLOC_H_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19/* XLATON */
20
21/*******************************************************************************
22* Exported Functions and Variables *
23*******************************************************************************/
24int heapInit(unsigned);
25void * malloc(unsigned);
26void * realloc(void *, unsigned);
27void free(void *);
28unsigned _memfree(void);
29unsigned _msize(void *);
30int _validptr(void *);
31int _validptr2(void *, unsigned);
32int _heap_check(void);
33
34extern unsigned _uHeapMinPtr;/* heap pointers are greater or equal to this.*/
35extern unsigned _uHeapMaxPtr;/* heap pointers are less than this. */
36
37
38/*******************************************************************************
39* Defined Constants And Macros *
40*******************************************************************************/
41#define MINPTR _uHeapMinPtr
42#define MAXPTR _uHeapMaxPtr
43
44#define HEAP_SIZE 0x00600000U /* 10MB of heap */
45
46/* HeapPointer assert */
47#define ltasserthp(a) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); return FALSE;}
48#define ltasserthp2(a,b) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); b; return FALSE;}
49#define _ltasserthp(a,b,c,d) _kprintf("ltasserthp: pv=%#.8x - '%s' in %s line %d - returns FALSE\n",a,b,c,d)
50#define ltasserthps(a,b) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); return FALSE;}
51#define ltasserthps2(a,b,c) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); c; return FALSE;}
52#define _ltasserthps(a,b,c,d,e,f) _kprintf("ltasserthsp: pv=%#.8x cb=%#x - '%s' '%s' in %s line %d - returns FALSE\n",a,b,c,d,e,f)
53
54
55/* XLATOFF */
56#ifdef __cplusplus
57}
58#endif
59#endif /* _MALLOC_H_ */
60/* XLATON */
61
Note: See TracBrowser for help on using the repository browser.