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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_smallhash.h')
-rw-r--r--source/blender/blenlib/BLI_smallhash.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h
index 07bd9975467..f394a224ca1 100644
--- a/source/blender/blenlib/BLI_smallhash.h
+++ b/source/blender/blenlib/BLI_smallhash.h
@@ -39,17 +39,16 @@ typedef struct {
void *val;
} SmallHashEntry;
-/*how much stack space to use before dynamically allocating memory*/
-#define SMSTACKSIZE 64
+/* how much stack space to use before dynamically allocating memory.
+ * set to match one of the values in 'hashsizes' to avoid too many mallocs */
+#define SMSTACKSIZE 131
typedef struct SmallHash {
- SmallHashEntry *buckets;
- SmallHashEntry *buckets_stack;
- SmallHashEntry *buckets_copy;
- SmallHashEntry _buckets_stack[SMSTACKSIZE];
- SmallHashEntry _buckets_copy[SMSTACKSIZE];
unsigned int nbuckets;
unsigned int nentries;
unsigned int cursize;
+
+ SmallHashEntry *buckets;
+ SmallHashEntry buckets_stack[SMSTACKSIZE];
} SmallHash;
typedef struct {