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
2018-03-13Cleanup: doxygen commentsCampbell Barton
2018-02-18Cleanup: group BLI_ghash_utils.c API in BLU_ghash.hCampbell Barton
2018-02-15Cleanup: use '_len' instead of '_size' w/ BLI APICampbell Barton
- When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts.
2017-12-02BLI_ghash: Description of GHash, GSetCampbell Barton
Also some re-indenting.
2017-11-15GSet: utils to access data stored outside the setCampbell Barton
2017-08-23GHash: BLI_ghash_reinsert_key utility functionCampbell Barton
Useful when ghash keys are reallocated.
2017-08-11GHash: note that 'deprecated' is used for privateCampbell Barton
2017-05-30Move GHash/GSet/LinkList iterators to BLI filesSergey Sharybin
Those are not depsgraph or C++ specific and can be used by everyone.
2017-05-30Move hash_combine utility function to a more generic placeSergey Sharybin
This way everyone can benefit from it, not only dependency graph.
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-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-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-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-13Cleanup: fixes for building with recent clangCampbell Barton
2014-12-17Docs: comments (hash table & beauty fill)Campbell Barton
2014-12-09Fix T42488: Knife (selected_only + occlude) failedCampbell Barton
2014-09-25GHash: use bool for comparison (simplify compare)Campbell Barton
2014-08-12GHash: add flag get/set for gsetCampbell 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-18Correct casts for IS_EQ and other macro tweaksCampbell Barton
- ensure GET_INT_FROM_POINTER us only used to get values - rename STACK_POP_ELSE -> STACK_POP_DEFAULT
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-04-21GHash, Edgehash: add lookup_default() funcs.Campbell Barton
Returns a fallback argument when the key isn't found.
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.
2013-09-02add hash iterator functions to access the pointer to the value.Campbell Barton
2013-09-02add attributes to ghash and edgehash functions.Campbell Barton
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.
2013-08-26BKI_gset and EdgeSet api, use when hash values aren't used (reuses ghash ↵Campbell Barton
internally without allocating space for the value).
2013-08-25move doxy docs out of the ghash header into the C file.Campbell Barton
2013-08-25clearing the mempool can now keep more then a single element reserved.Campbell Barton
2013-08-25use ints for ghash/edgehash flags, since its allocated theres not much point ↵Campbell Barton
to try save a few bytes here.
2013-08-24add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a ↵Campbell Barton
reserve argument.
2013-08-24ghash and edgehash api, allow newly defined hashes to take in the size of ↵Campbell Barton
the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately).
2013-08-24Fix state losses for recursive outliner trees (e.g. datablocks editor)Sv. Lockal
In previous optimization in outliner I assumed that order in treehash was not important. But testing outliner in datablocks mode revealed a problem: when user expands multiple recursive levels and then closes any element, it always closed the top level of recursion. Now it should work fine with recursive trees. Now treehash contains groups of elements indexed by (id,nr,type). Adding an element with the same (id,nr,type) results in appending it to existing group. No duplicates are possible in treehash. This commit should also make lookups a little bit faster, because searching in small arrays by "used" is faster than searching in hashtable with duplicates by "id,nr,type,used".
2013-08-21rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()Campbell Barton
2013-08-18add hash function BLI_ghash_assign, BLI_edgehash_assignCampbell Barton
avoids remove,insert and only hashes the key once.
2013-08-18minor api cleanup for ghash/edgehashCampbell Barton
- use single inlined lookup function. - move comments into source. - pack iterator vars more efficiently.
2013-08-18add assert for hashes if an existing element is ever inserted into a ↵Campbell Barton
ghash/edgehash. the outliner does this intentionally, so add a flag to allow this situation optionally.
2013-08-01fix for BLI_ghash_clear from Sv. Lockal (lockal)Campbell Barton
2013-06-20reduce sign comparisons for ghash and add more strict warnings for gcc.Campbell Barton
2013-05-23Support for bridge tool subdivisions, smoothing and shape along the profile.Campbell Barton
also added the underlying subdivision as a standalone operator in the edge menu, named: subdivide edge-ring. http://www.graphicall.org/ftp/ideasman42/bridge_subd.png