|
26 | 26 | ****************************************************************************/ |
27 | 27 |
|
28 | 28 | #include <nuttx/config.h> |
| 29 | + |
29 | 30 | #include <nuttx/compiler.h> |
30 | 31 | #include <nuttx/kmalloc.h> |
31 | 32 |
|
| 33 | +#include <stdio.h> |
| 34 | +#include <string.h> |
| 35 | + |
32 | 36 | /**************************************************************************** |
33 | 37 | * Public Function Prototypes |
34 | 38 | ****************************************************************************/ |
35 | 39 |
|
36 | 40 | #if defined(CONFIG_FS_HEAPSIZE) && CONFIG_FS_HEAPSIZE > 0 |
37 | 41 | void fs_heap_initialize(void); |
38 | | -FAR void *fs_heap_zalloc(size_t size); |
39 | | -FAR void *fs_heap_malloc(size_t size); |
| 42 | +FAR void *fs_heap_zalloc(size_t size) malloc_like1(1); |
| 43 | +FAR void *fs_heap_malloc(size_t size) malloc_like1(1); |
40 | 44 | size_t fs_heap_malloc_size(FAR void *mem); |
41 | | -FAR void *fs_heap_realloc(FAR void *oldmem, size_t size); |
| 45 | +FAR void *fs_heap_realloc(FAR void *oldmem, size_t size) realloc_like(2); |
42 | 46 | void fs_heap_free(FAR void *mem); |
| 47 | +FAR char *fs_heap_strdup(FAR const char *s) malloc_like; |
| 48 | +int fs_heap_asprintf(FAR char **strp, FAR const char *fmt, ...) |
| 49 | + printf_like(2, 3); |
43 | 50 | #else |
44 | 51 | # define fs_heap_initialize() |
45 | 52 | # define fs_heap_zalloc kmm_zalloc |
46 | 53 | # define fs_heap_malloc kmm_malloc |
47 | 54 | # define fs_heap_malloc_size kmm_malloc_size |
48 | 55 | # define fs_heap_realloc kmm_realloc |
49 | 56 | # define fs_heap_free kmm_free |
| 57 | +# define fs_heap_strdup strdup |
| 58 | +# define fs_heap_asprintf asprintf |
50 | 59 | #endif |
51 | 60 |
|
52 | 61 | #endif |
0 commit comments