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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-02-17 01:37:14 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-17 01:42:16 +0300
commit00133ba8f098fece41c4f358a57c7ba323214502 (patch)
treec736802ef75e509ce832a5370914e3ecedbed7db /source/blender/blenkernel/intern/CCGSubSurf.c
parent1e00e87e3a312ecd98f582dfa6493bb088865085 (diff)
Subsurf: Use guarded allocator for non-arena CCG
Our new guarded allocator implementation has much smaller memory block size overhead and doesn't have any locks now. So in order to make fuller track of what's happening in blender and avoid confusion why certain circumstances reports much less memory than others we'll now switch to guarded allocator. This was actually one of the biggest reasons of the confusion in the recent memory usage investigation. There's still some overhead is happening due to non-freeing nature of arena allocator but the things are not nearly as bad as they looked before: memory overhead is measured in tens of megabytes, not hundreds as it looked before. Plus with some smarter allocation policy we can almost eliminate this overhead.
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index 9e5d4afffe2..651979cd5cd 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -213,15 +213,15 @@ static int _ehashIterator_isStopped(EHashIterator *ehi)
static void *_stdAllocator_alloc(CCGAllocatorHDL UNUSED(a), int numBytes)
{
- return malloc(numBytes);
+ return MEM_mallocN(numBytes, "CCG standard alloc");
}
static void *_stdAllocator_realloc(CCGAllocatorHDL UNUSED(a), void *ptr, int newSize, int UNUSED(oldSize))
{
- return realloc(ptr, newSize);
+ return MEM_reallocN(ptr, newSize);
}
static void _stdAllocator_free(CCGAllocatorHDL UNUSED(a), void *ptr)
{
- free(ptr);
+ MEM_freeN(ptr);
}
static CCGAllocatorIFC *_getStandardAllocatorIFC(void)