Embedded Artistry libmemory
Memory library for embedded systems (malloc and friends)
aligned_malloc.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2017 Embedded Artistry LLC.
3 * License: MIT. See LICENSE file for details.
4 */
5 
6 #ifndef ALIGNED_MALLOC_H_
7 #define ALIGNED_MALLOC_H_
8 
9 #include <stddef.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
35 void* aligned_malloc(size_t align, size_t size);
36 
57 #define memalign(align, size) aligned_malloc(align, size)
58 
74 int posix_memalign(void **memptr, size_t alignment, size_t size);
75 
85 void aligned_free(void* ptr);
86 
87 #ifdef __cplusplus
88 } // extern "C"
89 #endif
90 
91 #endif // ALIGNED_MALLOC_H_
int posix_memalign(void **memptr, size_t alignment, size_t size)
Definition: posix_memalign.c:8
void aligned_free(void *ptr)
Free aligned memory.
void * aligned_malloc(size_t align, size_t size)
Allocated aligned memory.