Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/BLI_memarena.c')
-rw-r--r--source/blender/blenlib/intern/BLI_memarena.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c
index 07e22b30fcc..de2a73e065f 100644
--- a/source/blender/blenlib/intern/BLI_memarena.c
+++ b/source/blender/blenlib/intern/BLI_memarena.c
@@ -34,13 +34,10 @@
#include "BLI_memarena.h"
#include "BLI_linklist.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
struct MemArena {
unsigned char *curbuf;
int bufsize, cursize;
+ const char *name;
int use_calloc;
int align;
@@ -48,10 +45,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 +92,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);