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

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

Corrections to make win32k work.
(And now it does work, at least at my test machine...)

File size: 2.4 KB
Line 
1/* $Id: malloc.h,v 1.3 1999-10-27 02:02:57 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#ifdef __MALLOC_H
16 #error("A different version of malloc.h has allready been loaded!")
17#endif
18#define __malloc_h
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23/* XLATON */
24
25/*******************************************************************************
26* Exported Functions and Variables *
27*******************************************************************************/
28int heapInit(unsigned);
29void * malloc(unsigned);
30void * realloc(void *, unsigned);
31void free(void *);
32unsigned _memfree(void);
33unsigned _msize(void *);
34int _validptr(void *);
35int _validptr2(void *, unsigned);
36int _heap_check(void);
37
38extern unsigned _uHeapMinPtr;/* heap pointers are greater or equal to this.*/
39extern unsigned _uHeapMaxPtr;/* heap pointers are less than this. */
40
41
42/*******************************************************************************
43* Defined Constants And Macros *
44*******************************************************************************/
45#define MINPTR _uHeapMinPtr
46#define MAXPTR _uHeapMaxPtr
47
48/*#define HEAP_SIZE 0x00600000U*/ /* 10MB of heap */
49#define HEAP_SIZE 0x100000U /* 1MB of heap */
50
51/* HeapPointer assert - old ones... */
52#define ltasserthp(a) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); return FALSE;}
53#define ltasserthp2(a,b) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); b; return FALSE;}
54#define _ltasserthp(a,b,c,d) _kprintf("ltasserthp: pv=%#.8x - '%s' in %s line %d - returns FALSE\n",a,b,c,d)
55#define ltasserthps(a,b) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); return FALSE;}
56#define ltasserthps2(a,b,c) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); c; return FALSE;}
57#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)
58
59
60/* XLATOFF */
61#ifdef __cplusplus
62}
63#endif
64#endif /* _MALLOC_H_ */
65/* XLATON */
66
Note: See TracBrowser for help on using the repository browser.