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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-03 21:53:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-03 21:53:41 +0400
commit2a8d76d7342b0064284075bb5b88d964eda32e87 (patch)
tree80ddb787fb51929ab80b9863710cb1a19ce27cb9 /intern/guardedalloc/intern/mallocn.c
parent5f72462e38e940a0e1e03ee682d159c1aabbc309 (diff)
add versions of MEM_reallocN, MEM_recallocN which take a string arg so new allocs have an ID, changing existing functions signatures would be too disruptive at the moment.
Diffstat (limited to 'intern/guardedalloc/intern/mallocn.c')
-rw-r--r--intern/guardedalloc/intern/mallocn.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 4a72089f8f7..3a37b03ece4 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -371,7 +371,7 @@ void *MEM_dupallocN(const void *vmemh)
return newp;
}
-void *MEM_reallocN(void *vmemh, size_t len)
+void *MEM_reallocN_id(void *vmemh, size_t len, const char *str)
{
void *newp = NULL;
@@ -394,13 +394,13 @@ void *MEM_reallocN(void *vmemh, size_t len)
MEM_freeN(vmemh);
}
else {
- newp = MEM_mallocN(len, __func__);
+ newp = MEM_mallocN(len, str);
}
return newp;
}
-void *MEM_recallocN(void *vmemh, size_t len)
+void *MEM_recallocN_id(void *vmemh, size_t len, const char *str)
{
void *newp = NULL;
@@ -428,12 +428,23 @@ void *MEM_recallocN(void *vmemh, size_t len)
MEM_freeN(vmemh);
}
else {
- newp = MEM_callocN(len, __func__);
+ newp = MEM_callocN(len, str);
}
return newp;
}
+
+void *MEM_reallocN(void *vmemh, size_t len)
+{
+ return MEM_reallocN_id(vmemh, len, __func__);
+}
+void *MEM_recallocN(void *vmemh, size_t len)
+{
+ return MEM_recallocN_id(vmemh, len, __func__);
+}
+
+
#ifdef DEBUG_BACKTRACE
# if defined(__linux__) || defined(__APPLE__)
static void make_memhead_backtrace(MemHead *memh)