ReactOS 0.4.16-dev-106-g10b08aa
heap.h
Go to the documentation of this file.
1/*
2 * Wine heap memory allocation wrappers
3 *
4 * Copyright 2006 Jacek Caban for CodeWeavers
5 * Copyright 2013, 2018 Michael Stefaniuc
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#ifndef __WINE_WINE_HEAP_H
23#define __WINE_WINE_HEAP_H
24
25#include <winbase.h>
26
27static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(SIZE_T len)
28{
29 return HeapAlloc(GetProcessHeap(), 0, len);
30}
31
32static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(SIZE_T len)
33{
35}
36
37static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, SIZE_T len)
38{
39 if (!mem)
40 return HeapAlloc(GetProcessHeap(), 0, len);
42}
43
44static inline void heap_free(void *mem)
45{
47}
48
49static inline void *heap_calloc(SIZE_T count, SIZE_T size)
50{
51 SIZE_T len = count * size;
52
53 if (size && len / size != count)
54 return NULL;
56}
57
58#endif /* __WINE_WINE_HEAP_H */
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
static void heap_free(void *mem)
Definition: heap.h:44
Definition: mem.c:156
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define __WINE_ALLOC_SIZE(x)
Definition: winnt_old.h:84