fs_heap: add memalign interface
So the share memory can use it to malloc aligned memory. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
32784b0898
commit
22bcb88687
|
@ -68,6 +68,11 @@ FAR void *fs_heap_realloc(FAR void *oldmem, size_t size)
|
|||
return mm_realloc(g_fs_heap, oldmem, size);
|
||||
}
|
||||
|
||||
FAR void *fs_heap_memalign(size_t alignment, size_t size)
|
||||
{
|
||||
return mm_memalign(g_fs_heap, alignment, size);
|
||||
}
|
||||
|
||||
void fs_heap_free(FAR void *mem)
|
||||
{
|
||||
mm_free(g_fs_heap, mem);
|
||||
|
|
|
@ -43,6 +43,7 @@ FAR void *fs_heap_zalloc(size_t size) malloc_like1(1);
|
|||
FAR void *fs_heap_malloc(size_t size) malloc_like1(1);
|
||||
size_t fs_heap_malloc_size(FAR void *mem);
|
||||
FAR void *fs_heap_realloc(FAR void *oldmem, size_t size) realloc_like(2);
|
||||
FAR void *fs_heap_memalign(size_t alignment, size_t size) malloc_like1(3);
|
||||
void fs_heap_free(FAR void *mem);
|
||||
FAR char *fs_heap_strdup(FAR const char *s) malloc_like;
|
||||
FAR char *fs_heap_strndup(FAR const char *s, size_t size) malloc_like;
|
||||
|
@ -54,6 +55,7 @@ int fs_heap_asprintf(FAR char **strp, FAR const char *fmt, ...)
|
|||
# define fs_heap_malloc kmm_malloc
|
||||
# define fs_heap_malloc_size kmm_malloc_size
|
||||
# define fs_heap_realloc kmm_realloc
|
||||
# define fs_heap_memalign kmm_memalign
|
||||
# define fs_heap_free kmm_free
|
||||
# define fs_heap_strdup strdup
|
||||
# define fs_heap_strndup strndup
|
||||
|
|
Loading…
Reference in New Issue