Commit Graph

33 Commits

Author SHA1 Message Date
e7374d0227 Docs: minor comment edits to smallhash 2016-02-10 23:28:16 +11:00
88d5d99130 Tweaks to the comments of smallhash
Collaboration between russki guy working from Netherlands and
ausie bloke working from Australia (not Austria).
2016-02-10 10:52:24 +01:00
d4aaa4f9b6 cleanup: use const for smallhash & minor edits 2014-12-18 13:12:25 +01:00
d5abe8419d Smallhash: add support for iterating value pointers
also add reinsert function
2014-12-09 17:18:05 +01:00
151800662f Smallhash: BLI_smallhash_calc_quality
Also add inline hashing function to measure different methods.
2014-08-23 21:18:11 +10:00
d419e2e90c WM: add WM_operator_properties_create_ptr
Call operator types directly and avoid a lookup when their known.
2014-07-11 15:07:55 +10:00
95b93b5d46 Add BLI_compiler_compat.h to help with portability 2014-05-02 01:14:15 +10:00
af86b008b2 Include removal gave problems with windows, ifdef some back in for windows only 2014-05-01 07:21:08 +10:00
cb48c0ceea Revert "Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc7a."
This reverts commit a47a4ef82f.
2014-05-01 07:20:46 +10:00
a47a4ef82f Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc. 2014-04-30 23:16:12 +02:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
dda63375b2 Fix: Compile error due to missing #define for MSVC9 (VisualC++ 2008)
Added some relevant #defines copied from extern\libmv\third_party\msinttypes to BLI_sys_types.h so they can be used in blenlib. Made smallhash.c use the BLI_sys_types.h include rather than including <stdint.h> directly
2014-02-02 14:40:52 +01:00
41cc86a666 Add include needed for clang, quiet warning 2014-02-02 21:33:52 +11:00
c4345a808c Smallhash: add reserve option to avoid resizing when size is known 2014-02-02 17:08:26 +11:00
dcd90d67c8 Smallhash: fixes/improvements
- use magic numbers based on uintptr max, not uint max, to avoid possible collisions with real pointer values on 64bit systems.
- comment BLI_smallhash_remove for now, its not used.
- added smallhash_val_is_used replacing ELEM() checks
- updated docs
2014-02-02 16:24:33 +11:00
7c9b106589 Smallhash: optimizations
- remove static array used only for copying (use alloca on resize)
- set SMSTACKSIZE to one of the values in 'hashsizes' since the full available size was never used.
- ensure ~1.5x as many buckets as entries, was 3x which caused malloc's quite early on.
2014-02-02 02:24:48 +11:00
1f64371ec0 Smallhash: refactor and fixes
- BLI_smallhash_remove didnt decrement total entries.
- rename vars to match closer to ghash.
- smallhash_lookup returns NULL when no entry found.
- using a zero value key wasn't supported.
- no need to memset or calloc bucket arrays
- add asserts for unsupported conditions.
- added BLI_smallhash_lookup_p
2014-01-30 21:10:55 +11:00
c2da706a36 Code cleanup: remove references to svn and code style 2014-01-28 23:01:22 +11:00
d292d6ad74 Cleanup of BLI_smallhash
Factorized a bit the code here, think it's more readable now... No performance enhancement though.

Reviewed by: campbellbarton

Differential Revision: https://developer.blender.org/D259
2014-01-26 15:18:02 +01:00
4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
afab39b9d6 code cleanup: use const's for static arrays 2013-10-10 20:22:17 +00:00
8beb565c59 code cleanup: headers - doxy comments. 2013-09-12 03:02:50 +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
9d4bf6b37b change CHECK_TYPE_INLINE macro not to add the pointer in the macro. 2013-08-17 04:48:34 +00:00
1fb980e7df reduce sign conversion comparisons for smallhash and tweak warnings elsewhere. 2013-06-22 20:20:06 +00:00
62db610220 use unsigned int's for smallhash, avoids using ABS when converting an
int from a key.
2013-05-08 12:54:07 +00:00
46b40e112b skip checks in statvis_calc_thickness(). also remove paranoid NULL checks in smallhash.c 2013-04-20 16:49:02 +00:00
fb6ded3f59 bad use of assignment within ABS() caused SMHASH_NEXT macro to step the offset twice in some cases. 2012-11-06 04:17:46 +00:00
2f2b15bbb2 style cleanup: whitespace, bli & makesdna 2012-05-12 15:02:10 +00:00
02987fd5e1 fix [#30220] Knife Tool Leaks memory
both crash and leak are fixed now.
2012-02-17 05:33:23 +00:00
9a92cd8008 bmesh minor refactor
* add DM_to_bmesh_ex, DM_to_bmesh for converting a derived mesh to a BMesh (rather than a BMEditMesh)
* have a generic variable for allocsize: bm_mesh_allocsize_default, rather than copying the values about.
2012-02-12 17:44:10 +00:00
91390b712a GPL Header Cleanup 2012-02-11 04:16:17 +00:00
fa59b80189 move smallhash into its own C file, was inlineing fairly large functions. 2011-09-09 02:52:20 +00:00