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

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

Updated option/argument handling.
Corrected a few bugs.

File size: 2.3 KB
Line 
1/* $Id: malloc.h,v 1.4 1999-10-31 23:57:04 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/* HeapPointer assert - old ones... */
49#define ltasserthp(a) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); return FALSE;}
50#define ltasserthp2(a,b) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); b; return FALSE;}
51#define _ltasserthp(a,b,c,d) _kprintf("ltasserthp: pv=%#.8x - '%s' in %s line %d - returns FALSE\n",a,b,c,d)
52#define ltasserthps(a,b) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); return FALSE;}
53#define ltasserthps2(a,b,c) if (!_validptr2((void*)(a),(unsigned)(b))){ _ltasserthsp((void*)(a), (unsigned)(b), #a, #b,__FILE__,__LINE__); c; return FALSE;}
54#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)
55
56
57/* XLATOFF */
58#ifdef __cplusplus
59}
60#endif
61#endif /* _MALLOC_H_ */
62/* XLATON */
63
Note: See TracBrowser for help on using the repository browser.