Commit Graph

52 Commits

Author SHA1 Message Date
2dc988df8c reorder BLI_strict_flags.h include so its not conflicting with stdio.h on apple. 2013-09-03 04:39:12 +00:00
1ea9f88ff9 warning cleanup: correct some odd returns and quiet strict flag warnings on some systems. 2013-09-02 17:59:04 +00:00
2924a02a35 move strict compiler checks into a header so its easier to manage in one place (pragmas were copied around).
also enable more strict warnings for BLF (which had some incorrect casts).
2013-09-01 00:46:04 +00:00
8e46cf637c tweak mempool loop comparisons when we know there is no chance for skipping past the last value.
also correct typo.
2013-08-31 02:12:31 +00:00
f477c0e535 remove unnecessary check in BLI_mempool_iterstep and add doxygen comments to mempool. 2013-08-30 22:04:37 +00:00
b8547074e1 mempool internal change, use unsigned ints where possible (less overhead),
also quiet compiler warning for BLI_LINKSTACK_FREE macro.
2013-08-30 21:32:57 +00:00
8ef934c73f ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
2013-08-26 23:37:08 +00:00
e2bd3a4644 clearing the mempool can now keep more then a single element reserved. 2013-08-25 16:16:38 +00:00
28243b2e5f fix leak in BLI_ghash_clear(). was never freeing entries, add BLI_mempool_clear utility function. 2013-08-25 14:58:26 +00:00
e4d278668f code cleanup for mempool, refactor chunk initialization into a static function. 2013-08-25 14:50:40 +00:00
a476459c5e merge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc. 2013-08-25 13:15:22 +00:00
89c7cf1a49 style cleanup: also use ARRAY_HAS_ITEM macro for mempool check 2013-08-21 02:29:13 +00:00
bec9bcc14c Added check for address being freed by mempool free
When blender is built in debug mode, BLI_mempool_free will
ensure address passed to the function actually belongs to
this pool.

--
svn merge -r58710:58711 ^/branches/soc-2013-depsgraph_mt
2013-08-19 10:18:25 +00:00
2497084744 mempool api cleanup: differentiate mempool functions that allocate a pointer lookup table from allocating the data as a contiguous array,
call these functions BLI_mempool_as_table(), BLI_mempool_as_array(), the N prefixed versions of these functions return newly allocated arrays.
2013-08-04 19:40:50 +00:00
66a4077927 fix for [#36260] 2,300 Objects Makes Blender Unresponsive
- performance of outliner was low because of unoptimal data structures.
- now it uses BLI_mempool instead of custom mempool and GHash to make searches for duplicates faster.
- also fix undesired behaviour of BLI_mempool_as_arrayN

thanks to Campbell Barton and Lukas Tönne for helping me get a better fix put together.
2013-08-03 11:35:09 +00:00
bc5ecbc393 optimization: avoid extra loop in BLI_mempool_destroy(). free the list inline. 2013-07-19 10:40:57 +00:00
1fb980e7df reduce sign conversion comparisons for smallhash and tweak warnings elsewhere. 2013-06-22 20:20:06 +00:00
Dalai Felinto
d23bf09712 build fix for old gccs (after rev.57620)
enabling the new pragmas only when gcc >= 4.6
gcc 4.2.1 here (OSX)
2013-06-22 20:00:17 +00:00
2efea8cf03 reduce sign comparisons for ghash and add more strict warnings for gcc. 2013-06-20 19:39:29 +00:00
3b341068ba warn of sign conversions for low level apis - ghash, heap, mempool 2013-05-08 12:55:51 +00:00
34805a4752 BLI_mempool totalloc was being used un-initialized, normally this would cause bugs but turns out its not used,
ifdef'd it out but keep in the struct in BLI_mempool for now.
2013-02-17 05:16:48 +00:00
f46ca7836d add debug check for mempool double free (or misuse of BLI_MEMPOOL_ALLOW_ITER),
some reports in the tracker show errors on bmesh iteration which could be caused by this.
2013-02-15 04:14:53 +00:00
00025c74b4 add BLI_mempool_as_arrayN utility function for getting the mempool as a new array (utility function currently unused). 2013-01-30 21:17:09 +00:00
9a4da5a2f1 utility function to get a mempool as a pointer array. 2013-01-19 03:51:17 +00:00
bf355362b1 replace error prints with asserts in BLI_mempool when an iterator function is called on a non-iterator flagged pool. 2013-01-19 03:16:52 +00:00
aaafa0c2fe code cleanup: move file string defines into BLI_path_utils.h, BKE_utildefines is now unused but keep incase we want to add defines there later. 2012-09-03 22:04:14 +00:00
bddc7dfc20 style cleanup: remaining BLI files. 2012-05-12 15:13:06 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
b457c7fdbd style cleanup 2012-03-12 23:56:11 +00:00
cae11a98f9 style cleanup 2012-03-11 23:47:41 +00:00
c26f5035b6 style cleanup for mempool 2012-03-01 23:14:51 +00:00
bc767059cb Code Cleanup: update to mempool, use flag rather then bool args. 2012-03-01 22:59:18 +00:00
7cc206ddca Code Cleanup: remove non existing function declarations.
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
2012-02-29 15:00:37 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
d14edecabf optimized mempool iterator from bmesh 2011-12-29 03:39:59 +00:00
1ca7c2e4f3 BLI_mempool_findelem() only worked when no elements were freed, use the iterator for now. 2011-11-27 21:11:17 +00:00
8423b1b33a mempool utility function to get the element at an index BLI_mempool_findelem(), not used yet. 2011-11-27 01:20:08 +00:00
68fa959de5 BLI_mempool redefined causing compile time error, removing duplicate typedef 2011-11-16 22:20:17 +00:00
3dcc9aef96 merge mempool changes from bmesh (adds mempool iterator). 2011-11-16 19:31:42 +00:00
1af839081b minor edits, move mempool stack vars into the nested scope when they aren't likely to be used, also formatting edits (was quite un-blender like). 2011-11-16 16:50:30 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Nathan Letwory
7900b5949f doxygen: blender/blenlib tagged. 2011-02-27 20:37:56 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
8b7482892b made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. 2011-02-14 17:55:27 +00:00
001259ccb6 warning/portability fixes. 2010-10-30 17:16:37 +00:00
07b547980d remove unused includes for blenlib, left ifdef's for non linux os's alone. 2010-03-20 18:52:03 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
7d2d5c990f fix for uninitialized mempool variable. 2010-02-09 12:06:04 +00:00
7ad7820f7f Added a new notifyer, NC_SPACE_CHANGED, to signal an editor that
replaces another so it can do updates (e.g. dopesheet editor can
sync channel selection).

Also coded a simple optimization for allocating small objects,
based on mempools.  It's #ifdef'd out, you can enabled it by 
defining OPTIMIZE_SMALL_BLOCKS (e.g. adding -DDOPTIMIZE_SMALL_BLOCKS to
your compiler flags).

We suffer from a great deal of performance loss from the system allocator
(vgroups, ghash, edgehash, the singly-linked list implementation in blenlib,
editmesh, and likely a great many areas I'm forgetting), and this is the 
common solution for handling the many-small-objects problem.  It's not
really production-ready yet (it's long-term memory consequencers need to
be profiled first, and the implementation tweaked as necassary), but for
people on systems with slow system allocators it's worth trying.

Note that since this creates a guardedalloc<->blenlib link, the build systems
need to be updated accordingly (I've already done this for scons, though I'm
not sure if the player builds).
2010-01-21 03:08:57 +00:00
3f9d3b2a0b commit of mempool 64-bit fix for 2.5-er, trunk as well 2009-09-12 13:27:26 +00:00