1 | /*
|
---|
2 | * Heap definitions
|
---|
3 | *
|
---|
4 | * Copyright 2001 Francois Gouget.
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_MALLOC_H
|
---|
31 | #define __WINE_MALLOC_H
|
---|
32 |
|
---|
33 | #include <crtdefs.h>
|
---|
34 |
|
---|
35 | /* heap function constants */
|
---|
36 | #define _HEAPEMPTY -1
|
---|
37 | #define _HEAPOK -2
|
---|
38 | #define _HEAPBADBEGIN -3
|
---|
39 | #define _HEAPBADNODE -4
|
---|
40 | #define _HEAPEND -5
|
---|
41 | #define _HEAPBADPTR -6
|
---|
42 |
|
---|
43 | #define _FREEENTRY 0
|
---|
44 | #define _USEDENTRY 1
|
---|
45 |
|
---|
46 | #ifndef _HEAPINFO_DEFINED
|
---|
47 | #define _HEAPINFO_DEFINED
|
---|
48 | typedef struct _heapinfo
|
---|
49 | {
|
---|
50 | int* _pentry;
|
---|
51 | size_t _size;
|
---|
52 | int _useflag;
|
---|
53 | } _HEAPINFO;
|
---|
54 | #endif /* _HEAPINFO_DEFINED */
|
---|
55 |
|
---|
56 | #ifdef __i386__
|
---|
57 | extern unsigned int* __cdecl __p__amblksiz(void);
|
---|
58 | #define _amblksiz (*__p__amblksiz());
|
---|
59 | #else
|
---|
60 | extern unsigned int _amblksiz;
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | #ifdef __cplusplus
|
---|
64 | extern "C" {
|
---|
65 | #endif
|
---|
66 |
|
---|
67 | void* __cdecl _expand(void*,size_t);
|
---|
68 | int __cdecl _heapadd(void*,size_t);
|
---|
69 | int __cdecl _heapchk(void);
|
---|
70 | int __cdecl _heapmin(void);
|
---|
71 | int __cdecl _heapset(unsigned int);
|
---|
72 | size_t __cdecl _heapused(size_t*,size_t*);
|
---|
73 | int __cdecl _heapwalk(_HEAPINFO*);
|
---|
74 | size_t __cdecl _msize(void*);
|
---|
75 |
|
---|
76 | void* __cdecl calloc(size_t,size_t);
|
---|
77 | void __cdecl free(void*);
|
---|
78 | void* __cdecl malloc(size_t);
|
---|
79 | void* __cdecl realloc(void*,size_t);
|
---|
80 |
|
---|
81 | void __cdecl _aligned_free(void*);
|
---|
82 | void* __cdecl _aligned_malloc(size_t,size_t);
|
---|
83 | void* __cdecl _aligned_offset_malloc(size_t,size_t,size_t);
|
---|
84 | void* __cdecl _aligned_realloc(void*,size_t,size_t);
|
---|
85 | void* __cdecl _aligned_offset_realloc(void*,size_t,size_t,size_t);
|
---|
86 |
|
---|
87 | size_t __cdecl _get_sbh_threshold(void);
|
---|
88 | int __cdecl _set_sbh_threshold(size_t size);
|
---|
89 |
|
---|
90 | #ifdef __cplusplus
|
---|
91 | }
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | # ifdef __GNUC__
|
---|
95 | # define _alloca(x) __builtin_alloca((x))
|
---|
96 | # define alloca(x) __builtin_alloca((x))
|
---|
97 | # endif
|
---|
98 |
|
---|
99 | #endif /* __WINE_MALLOC_H */
|
---|