ReactOS 0.4.16-dev-2122-g1628f5e
malloc.h
Go to the documentation of this file.
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#ifndef __WINE_MALLOC_H
21#define __WINE_MALLOC_H
22
23#include <corecrt.h>
24#include <corecrt_malloc.h>
25
26/* heap function constants */
27#define _HEAPEMPTY -1
28#define _HEAPOK -2
29#define _HEAPBADBEGIN -3
30#define _HEAPBADNODE -4
31#define _HEAPEND -5
32#define _HEAPBADPTR -6
33
34#define _FREEENTRY 0
35#define _USEDENTRY 1
36
37#ifndef _HEAPINFO_DEFINED
38#define _HEAPINFO_DEFINED
39typedef struct _heapinfo
40{
41 int* _pentry;
42 size_t _size;
45#endif /* _HEAPINFO_DEFINED */
46
47#ifdef __i386__
48_ACRTIMP unsigned int* __cdecl __p__amblksiz(void);
49#define _amblksiz (*__p__amblksiz());
50#else
51extern unsigned int _amblksiz;
52#endif
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58_ACRTIMP int __cdecl _heapadd(void*,size_t);
59_ACRTIMP int __cdecl _heapchk(void);
60_ACRTIMP int __cdecl _heapmin(void);
61_ACRTIMP int __cdecl _heapset(unsigned int);
62_ACRTIMP size_t __cdecl _heapused(size_t*,size_t*);
64
68
69#ifdef _MSC_VER
70void *_alloca(size_t size);
71#endif
72
73#ifdef __cplusplus
74}
75#endif
76
77# ifdef __GNUC__
78# define _alloca(x) __builtin_alloca((x))
79# define alloca(x) __builtin_alloca((x))
80# elif defined(_MSC_VER)
81# define alloca(x) _alloca((x))
82# endif
83
84#endif /* __WINE_MALLOC_H */
unsigned int *CDECL __p__amblksiz(void)
Definition: heap.c:507
int intptr_t
Definition: corecrt.h:176
#define __cdecl
Definition: corecrt.h:121
#define _ACRTIMP
Definition: corecrt.h:153
struct _heapinfo _HEAPINFO
_ACRTIMP intptr_t __cdecl _get_heap_handle(void)
Definition: heap.c:346
_ACRTIMP int __cdecl _set_sbh_threshold(size_t size)
Definition: heap.c:523
unsigned int _amblksiz
_ACRTIMP int __cdecl _heapadd(void *, size_t)
Definition: heap.c:336
_ACRTIMP int __cdecl _heapwalk(_HEAPINFO *)
Definition: heap.c:273
_ACRTIMP int __cdecl _heapchk(void)
Definition: heap.c:244
_ACRTIMP size_t __cdecl _heapused(size_t *, size_t *)
Definition: stubs.c:22
_ACRTIMP int __cdecl _heapmin(void)
Definition: heap.c:258
_ACRTIMP size_t __cdecl _get_sbh_threshold(void)
Definition: heap.c:515
_ACRTIMP int __cdecl _heapset(unsigned int)
Definition: heap.c:317
GLsizeiptr size
Definition: glext.h:5919
int * _pentry
Definition: malloc.h:41
int _useflag
Definition: malloc.h:43
size_t _size
Definition: malloc.h:42