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 /intern/guardedalloc/MEM_guardedalloc.h | |
parent | ac8c56c6fc9e1a816160144b5cebe2e99ffa67fc (diff) |
use gcc attributes for BLI alloc functions
Diffstat (limited to 'intern/guardedalloc/MEM_guardedalloc.h')
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 7fcfba5afec..dfb3fe69474 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -60,8 +60,8 @@ #ifndef __MEM_GUARDEDALLOC_H__ #define __MEM_GUARDEDALLOC_H__ -#include <stdio.h> /* needed for FILE* */ -#include "MEM_sys_types.h" /* needed for uintptr_t */ +#include <stdio.h> /* needed for FILE* */ +#include "MEM_sys_types.h" /* needed for uintptr_t */ #ifdef __cplusplus extern "C" { @@ -70,7 +70,7 @@ extern "C" { /** Returns the length of the allocated memory segment pointed at * by vmemh. If the pointer was not previously allocated by this * module, the result is undefined.*/ - size_t MEM_allocN_len(void *vmemh) + size_t MEM_allocN_len(const void *vmemh) #ifdef __GNUC__ __attribute__((warn_unused_result)) #endif @@ -111,10 +111,10 @@ extern "C" { * Allocate a block of memory of size len, with tag name str. The * memory is cleared. The name must be static, because only a * pointer to it is stored ! */ - void *MEM_callocN(size_t len, const char * str) + void *MEM_callocN(size_t len, const char *str) #ifdef __GNUC__ __attribute__((warn_unused_result)) - __attribute__((nonnull)) + __attribute__((nonnull(2))) __attribute__((alloc_size(1))) #endif ; @@ -122,10 +122,10 @@ extern "C" { /** Allocate a block of memory of size len, with tag name str. The * name must be a static, because only a pointer to it is stored ! * */ - void *MEM_mallocN(size_t len, const char * str) + void *MEM_mallocN(size_t len, const char *str) #ifdef __GNUC__ __attribute__((warn_unused_result)) - __attribute__((nonnull)) + __attribute__((nonnull(2))) __attribute__((alloc_size(1))) #endif ; @@ -133,10 +133,10 @@ extern "C" { /** Same as callocN, clears memory and uses mmap (disk cached) if supported. * Can be free'd with MEM_freeN as usual. * */ - void *MEM_mapallocN(size_t len, const char * str) + void *MEM_mapallocN(size_t len, const char *str) #ifdef __GNUC__ __attribute__((warn_unused_result)) - __attribute__((nonnull)) + __attribute__((nonnull(2))) __attribute__((alloc_size(1))) #endif ; @@ -213,11 +213,10 @@ public: \ MEM_freeN(mem); \ } \ -#endif - +#endif /* __cplusplus */ #ifdef __cplusplus } -#endif +#endif /* __cplusplus */ -#endif +#endif /* __MEM_GUARDEDALLOC_H__ */ |