xref: /haiku/headers/posix/malloc.h (revision fc7456e9b1ec38c941134ed6d01c438cf289381e)
1 /*
2  * Copyright 2002-2021 Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _MALLOC_H
6 #define _MALLOC_H
7 
8 
9 #include <unistd.h>
10 
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 
17 extern void *malloc(size_t numBytes);
18 extern void *realloc(void *oldPointer, size_t newSize);
19 extern void *calloc(size_t numElements, size_t size);
20 extern void free(void *pointer);
21 extern void *memalign(size_t alignment, size_t numBytes) _ALIGNED_BY_ARG(1);
22 extern void *valloc(size_t numBytes);
23 
24 #ifdef _DEFAULT_SOURCE
25 size_t malloc_usable_size(void *ptr);
26 #endif
27 
28 
29 #ifdef __cplusplus
30 }
31 #endif
32 
33 #endif /* _MALLOC_H */
34