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
AgeCommit message (Collapse)Author
2016-06-08Cleanup: typoCampbell Barton
2016-06-01Revert "BLI_ghash: Fix initial over-allocation of mempool chunks."Bastien Montagne
Useless change in fact, sorry for the noise. This reverts commit b08473680e141ab6f28f99fc3b1dbbc4add89bed.
2016-06-01Revert "Correct invalid pointer-pair compare check"Campbell Barton
This reverts commit d5e0e681cea846facb4f2777921f6612be3ee193. Tsk, these functions return false on a match.
2016-06-01BLI_ghash: Fix initial over-allocation of mempool chunks.Bastien Montagne
Code intended to create only one pool by default here, but code in `mempool_maxchunks()` would make it two.
2016-05-26Correct invalid pointer-pair compare checkCampbell Barton
2016-03-29Fix error in ghash/gset_ensure_p_exCampbell Barton
The key is needed in the case the ghash resizes. Caused regression T47984.
2016-03-14Cleanup: style/spellingCampbell Barton
2016-03-09Cleanup: style, spellingCampbell Barton
2016-03-02GHash: BLI_ghash_ensure_p_ex now takes a pointer-to-key argCampbell Barton
This is an alternative to passing a copy callback which is some times inconvenient. Instead the caller can write to the key - needed when the key is duplicated memory. Allows for minor optimization in ghash/gset use. Also add BLI_gset_ensure_p_ex
2016-02-20Add GHash/GSet pop() feature.Bastien Montagne
Behavior is similar to python's set.pop(), it removes and returns a 'random' entry from the hash. Notes: * Popping will return items in same order as ghash/gset iterators (i.e. increasing order in internal buckets-based storage), unless ghash/gset is modified in between. * We are keeping a track of the latest bucket we popped out (through a 'state' parameter), this allows for similar performances to iterators when iteratively popping a whole hash (without it, we are roughly O(n!), with it we are roughly O(n)...). Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D1808
2015-11-29Cleanup: sync edgehash w/ ghash remove logicCampbell Barton
2015-11-29Cleanup: rename `hash` -> `bucket_index`, edgehash APICampbell Barton
Was confusing since a hash isn't typically used as an index on its own. Also C99 for loop for bucket resize loop.
2015-11-29Cleanup: ghash/edgehash styleCampbell Barton
Call functions on own lines (nicer for debugging)
2015-11-26Partial revert of last commitCampbell Barton
Keep index using the outer scope for GHASH iter macros, while its often nice, in some cases to declare in the for loop, it means you cant use as a counter after the loop exits, and in some cases signed/unsigned may matter. API changes should really be split off in their own commits too.
2015-11-26cleanup: C99 and vertex array commentsMike Erwin
GPU_buffer no longer has a fallback to client vertex arrays, so remove comments about it. Changed a few internal structs/function interfaces to use bool where appropriate. Use for-loop scope and flexible declaration placement. PBVH does the same thing but needs ~150 fewer lines to do it! The change to BLI_ghashIterator_init is admittedly hackish but makes GHASH_ITER_INDEX nicer to use.
2015-09-13Cleanup: spellingCampbell Barton
2015-07-02BLI_GHash: add BLI_gset_str_new helpers.Bastien Montagne
2015-05-11GHash: use const keys when only used for lookupsCampbell Barton
2015-05-11GHash: Add BLI_ghash_ensure_p_ex to copy the keyCampbell Barton
Needed in cases where the memory from each key is owned by the GHash.
2015-04-13GHash: use unsigned int for ghash_sizeCampbell Barton
2015-04-11BMesh: simplify hashing for dyntopoCampbell Barton
Was using pointer hashing when the keys are in fact uint's. Since they're well distributed from the rangetree, no need to do bit-shifting tricks. just use int as hash. Gives ~8% speedup in own tests.
2015-04-06GHash: ensure function, avoids multiple lookupsCampbell Barton
2015-04-06GHash: no reason to use GSetEntry in ghash APICampbell Barton
2015-03-23Cleanup: comments, styleCampbell Barton
2015-03-22Fix wrong sizeof() in new ghash hashing helpers code.Bastien Montagne
Spotted by Coverity.
2015-03-21Cleanup: use tabsCampbell Barton
2015-03-19GHash - code reorganization, performance enhancements, add a few missing ↵Bastien Montagne
utils to API. This patch is the root of the GHash rework, all other diff will be based on it: Reduce average load from 3.0 to 0.75 ---------------------------------- This is the big performance booster part, e.g. makes tracing a dyntopo stroke between 25% and 30% faster. Not much to say about it, aside that it obviously increase memory footprint (about 25% - 30% too). Add optional shrinking ---------------------------------- I.e. ghashes/gsets can now shrink their buckets array when you remove enough entries. This remains optional and OFF by default. Add code to use masking instead of modulo ---------------------------------- Buckets indices are obtained from hashes by “reducing” the hash value into the valid bucket range. This can be done either by bit-masking, or using modulo operation. The former is quicker, but requires real hashes, while the later is slower (average 10% impact on ghash operations) but can also be used as a 'fake' hashing on raw values, like e.g. indices. In Blender currently not all ghash usages actually hash their keys, so we stick to modulo for now (masking is ifdef’ed out), we may however investigate the benefits of switching to masking with systematic very basic hashing later… Add various missing API helpers ---------------------------------- I.e. a way to deep-copy a ghash/gset, and a way to (re-)reserve entries (i.e. manually grow or shrink the ghash after its creation). Various code refactoring ---------------------------------- * Get rid of the 'hack' regarding ghash size when used as gset (it’s simpler and safer to have two structs defined here, and cast pointers as needed). * Various re-shuffle and factorization in low-level internal code. * Some work on hashing helpers, introducing some murmur2a-based hashing too. Thanks a bunch to Campbell for the extensive review work. :) Reviewers: sergey, campbellbarton Subscribers: psy-fi, lukastoenne Projects: #bf_blender Maniphest Tasks: T43766 Differential Revision: https://developer.blender.org/D1178
2015-01-26Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).Bastien Montagne
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)' and 'strcmp(foo, bar) == 0' in several places...
2014-12-17Docs: comments (hash table & beauty fill)Campbell Barton
2014-09-25Fix previous commit rB34abb614f1344a6, which broke addons translations.Bastien Montagne
Ghash comp callbacks must return false in case a & b are equal! Also slightly cleaned up gash code using those comp func, since those return booleans now, let's compare tham against booleans!
2014-09-25GHash: use bool for comparison (simplify compare)Campbell Barton
2014-08-12GHash: add flag get/set for gsetCampbell Barton
2014-08-11CommentsCampbell Barton
2014-08-07GHash/EdgeHash: avoid NULL check on iterator initCampbell Barton
2014-07-30GHash: generic comparison for int[4]Campbell Barton
2014-07-14GHash, EdgeHash: add debugging function to measure the hash qualityCampbell Barton
Can use to check on improvements to hash functions.
2014-06-13GSet, GHash: Add BLI_gset_add, since its common to add members to a setCampbell Barton
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
2014-05-14Code cleanup: doxy commentsCampbell Barton
2014-04-21GHash, Edgehash: add lookup_default() funcs.Campbell Barton
Returns a fallback argument when the key isn't found.
2014-04-20GHash, EdgeHash: hint on unlikely branchCampbell Barton
also avoid searching buckets for empty hashes
2014-04-15GHash: add BLI_ghashutil_uinthash_v4 for hashing 4 ints at onceCampbell Barton
2014-04-15GHash: add typed hash functions (were all (void *))Campbell Barton
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing. - BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *) This also showed up incorrect use of inthash, which was using a pointer.
2014-04-08GHash/Edgehash: make simple iterator checking functions inline.Campbell Barton
also remove NULL check, only a few areas made use of this.
2014-04-05Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient nowCampbell Barton
2013-11-01code cleanup: spellingCampbell Barton
2013-09-02warning cleanup: correct some odd returns and quiet strict flag warnings on ↵Campbell Barton
some systems.
2013-09-02add hash iterator functions to access the pointer to the value.Campbell Barton
2013-09-01move strict compiler checks into a header so its easier to manage in one ↵Campbell Barton
place (pragmas were copied around). also enable more strict warnings for BLF (which had some incorrect casts).
2013-08-31mempool internal change, use unsigned ints where possible (less overhead),Campbell Barton
also quiet compiler warning for BLI_LINKSTACK_FREE macro.
2013-08-27ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it ↵Campbell Barton
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.