diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/blenlib/intern/BLI_memarena.c | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_memarena.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 07e22b30fcc..cdb88e91cad 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -41,6 +41,7 @@ struct MemArena { unsigned char *curbuf; int bufsize, cursize; + const char *name; int use_calloc; int align; @@ -48,10 +49,11 @@ struct MemArena { LinkNode *bufs; }; -MemArena *BLI_memarena_new(int bufsize) { +MemArena *BLI_memarena_new(int bufsize, const char *name) { MemArena *ma= MEM_callocN(sizeof(*ma), "memarena"); ma->bufsize= bufsize; ma->align = 8; + ma->name= name; return ma; } @@ -94,9 +96,9 @@ void *BLI_memarena_alloc(MemArena *ma, int size) { else ma->cursize = ma->bufsize; if(ma->use_calloc) - ma->curbuf= MEM_callocN(ma->cursize, "memarena calloc"); + ma->curbuf= MEM_callocN(ma->cursize, ma->name); else - ma->curbuf= MEM_mallocN(ma->cursize, "memarena malloc"); + ma->curbuf= MEM_mallocN(ma->cursize, ma->name); BLI_linklist_prepend(&ma->bufs, ma->curbuf); |