diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-14 16:47:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-14 16:47:49 +0400 |
commit | 98520ce4deccb24e5992930694bb4189f6fce0f3 (patch) | |
tree | f568145afab15183e27ddbc0b37b19ed5ffcc758 /source/blender/blenlib/BLI_memarena.h | |
parent | ac8c56c6fc9e1a816160144b5cebe2e99ffa67fc (diff) |
use gcc attributes for BLI alloc functions
Diffstat (limited to 'source/blender/blenlib/BLI_memarena.h')
-rw-r--r-- | source/blender/blenlib/BLI_memarena.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index abba03ece9d..2a2dd31b26f 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -50,16 +50,43 @@ extern "C" { struct MemArena; typedef struct MemArena MemArena; +struct MemArena *BLI_memarena_new(const int bufsize, const char *name) +#ifdef __GNUC__ +__attribute__((warn_unused_result)) +__attribute__((nonnull(2))) +#endif +; -struct MemArena *BLI_memarena_new(int bufsize, const char *name); -void BLI_memarena_free(struct MemArena *ma); +void BLI_memarena_free(struct MemArena *ma) +#ifdef __GNUC__ +__attribute__((nonnull(1))) +#endif +; -void BLI_memarena_use_malloc(struct MemArena *ma); -void BLI_memarena_use_calloc(struct MemArena *ma); +void BLI_memarena_use_malloc(struct MemArena *ma) +#ifdef __GNUC__ +__attribute__((nonnull(1))) +#endif +; +void BLI_memarena_use_calloc(struct MemArena *ma) +#ifdef __GNUC__ +__attribute__((nonnull(1))) +#endif +; -void BLI_memarena_use_align(struct MemArena *ma, int align); +void BLI_memarena_use_align(struct MemArena *ma, const int align) +#ifdef __GNUC__ +__attribute__((nonnull(1))) +#endif +; -void *BLI_memarena_alloc(struct MemArena *ma, int size); +void *BLI_memarena_alloc(struct MemArena *ma, int size) +#ifdef __GNUC__ +__attribute__((warn_unused_result)) +__attribute__((nonnull(1))) +__attribute__((alloc_size(2))) +#endif +; #ifdef __cplusplus } |