diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-02 10:46:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-02 10:51:27 +0400 |
commit | f64ae4cbe5a724496624de9e479c04f325613be5 (patch) | |
tree | 9631ba79b3c54ac3f6fa0619dff490e724ff1f94 /source/blender/blenlib/BLI_memarena.h | |
parent | 4436620150f2884a0b4b9e417b08e19f8a797a86 (diff) |
MemArena: use size_t instead of int for alloc args and internal storage.
also add BLI_memarena_calloc to be used when calloc isnt enabled for the arena.
Diffstat (limited to 'source/blender/blenlib/BLI_memarena.h')
-rw-r--r-- | source/blender/blenlib/BLI_memarena.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index 737324ebc16..8d5a7654425 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -52,12 +52,13 @@ extern "C" { struct MemArena; typedef struct MemArena MemArena; -struct MemArena *BLI_memarena_new(const int bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC; +struct MemArena *BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC; void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1); void BLI_memarena_use_malloc(struct MemArena *ma) ATTR_NONNULL(1); void BLI_memarena_use_calloc(struct MemArena *ma) ATTR_NONNULL(1); -void BLI_memarena_use_align(struct MemArena *ma, const int align) ATTR_NONNULL(1); -void *BLI_memarena_alloc(struct MemArena *ma, int size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2); +void BLI_memarena_use_align(struct MemArena *ma, const size_t align) ATTR_NONNULL(1); +void *BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2); +void *BLI_memarena_calloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2); void BLI_memarena_clear(MemArena *ma) ATTR_NONNULL(1); |