Age | Commit message (Collapse) | Author |
|
|
|
|
|
- replace numbers with defines for allocation increments and default array size.
- move array reallocation into a static function (deduplicate 2x).
also fix own mistake with uninitialized slop-space var in memory printing statistics.
|
|
This commit attempts to fix the following error:
intern\guardedalloc\intern\mallocn.c: In function 'rem_memblock':
intern\guardedalloc\intern\mallocn.c:977:48: error: conversion to 'intptr_t' from 'size_t' may change the sign of the result [-Werror=sign-conversion]
From the references I've managed to find, it appears that
the second arg to munmap() should be size_t not intptr_t.
Fortunately though, we don't use this arg anyways atm, so
this should be quite harmless...
|
|
|
|
guardedalloc optimizations were not entirely thread safe for mmap.
|
|
|
|
|
|
|
|
|
|
- Re-arrange locks, so no actual memory allocation
(which is relatively slow) happens from inside
the lock. operation system will take care of locks
which might be needed there on it's own.
- Use spin lock instead of mutex, since it's just
list operations happens from inside lock, no need
in mutex here.
- Use atomic operations for memory in use and total
used blocks counters.
This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.
There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization
|
|
guarded alloc.
--
svn merge -r58788:58789 ^/branches/soc-2013-depsgraph_mt
|
|
This is useful for benchmark tests, to make CPU cache
utilization as good as we could with current design.
|
|
from checking if resulting pointers alias existing pointers, also use sentinel attribute for uiButGetStrInfo so incorrect usage gives a warning.
|
|
|
|
allocs have an ID, changing existing functions signatures would be too disruptive at the moment.
|
|
|
|
|
|
|
|
Added an option to show backtrace from where
non-freed datablock was allocated from.
To enable this feature, simply enable DEBUG_BACKTRACE
in mallocn.c file and all unfreed datablocks will
be followed up by a backtrace.
Currently works on linux and osx only,
windows support is on TODO.
This feature is for sure disabled by default,
so does not affect any builds which don't
explicitly define DEBUG_BACKTRACE.
|
|
remove MEM_sys_types.h which was a duplicate.
|
|
|
|
a different function signature. (which evidently works but error prone).
|
|
also add asserts for listbase functions when the list is NULL, and use noreturn attribute for jpeg_error.
|
|
since guardedalloc confuses them.
The option cases a warning on build, since its ownly for experimental
use.
|
|
|
|
|
|
* r54117 broke Windows, __func__ not declared.
|
|
receiving a NULL value.
|
|
non-threadsafe usage of guarded allocator.
Also added small chunk of code to check consistency of begin/end
threaded malloc.
All this additional checks are commented and wouldn't affect on
builds, however found them helpful to troubleshoot issues so
decided to commit it to SVN.
|
|
This implements AO baking directly from multi-resolution mesh with much
less memory overhead than regular baker.
Uses rays distribution implementation from Morten Mikkelsen, raycast
is based on RayObject also used by Blender Internal.
Works in single-thread yet, multi-threading would be implemented later.
|
|
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
|
|
locking for its self (sculpt mode)
|
|
note: the caller can do locking to prevent errors - but this isn't being done in blender yet, so this prevents accidental allocs in openmp for now.
|
|
|
|
|
|
|
|
BKE_utildefines is now unused but keep incase we want to add defines there later.
|
|
memory for loaded fonts, not store as a temp var in the fonts.
|
|
|
|
|
|
also remove historic comment which isnt helpful.
|
|
attribute.
|
|
when using MEM_dupallocN. This helps figuring out issues with non-freed
dup_alloc blocks,
Simply enable DEBUG_MEMDUPLINAME in mallocn.c file.
|
|
named drarnode.c and node_draw.c.
|
|
|
|
uintptr_t to unsigned int (othe solution would be to use PRIuPTR macro from inttypes.h, but that would probably causes some problems with windows...).
|
|
|
|
shouldnt be NULL.
also remove IDP_AppendArray's return value which wasnt the new item in the array (which is odd/misleading), but wasnt used anywhere either.
|
|
|