We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcecae9 commit 1a83817Copy full SHA for 1a83817
simple_pool/CMakeLists.txt
@@ -19,7 +19,6 @@ add_compile_options(
19
-Wimplicit-fallthrough
20
-Wundef
21
-Wfloat-equal
22
- -march=native
23
-fPIE
24
-fno-omit-frame-pointer
25
)
simple_pool/dyn_mem_pool.h
@@ -313,6 +313,9 @@ void multipool_free(struct MultiPool* multipool) {
313
uint32_t find_multipool_index_for_size(uint32_t size) {
314
static const uint32_t int32bitcount = sizeof(uint32_t) * CHAR_BIT;
315
uint32_t size_value = (size - 1) >>DynPoolMinMultiPoolMemNodeSizeBits;
316
+ if( __builtin_expect(size_value == 0, 0)) {
317
+ return 0;
318
+ }
319
return (int32bitcount - (uint32_t)__builtin_clz(size_value));
320
}
321
0 commit comments