Compare commits
2
Commits
ce23d3995c
...
ceecc62a63
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceecc62a63 | ||
|
|
80f0697e79 |
+2
-1
@@ -69,7 +69,8 @@ if(HAS_FULL_RELRO)
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL
|
||||
arm64)
|
||||
add_compile_options(-mbranch-protection=standard)
|
||||
else()
|
||||
add_compile_options(-fcf-protection)
|
||||
|
||||
@@ -694,7 +694,12 @@ constexpr int getMaxCapacity(Node *self) {
|
||||
self->partialKeyLen);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Disabling the free list altogether is faster on my mac m1
|
||||
constexpr int64_t kMaxFreeListBytes = 0;
|
||||
#else
|
||||
constexpr int64_t kMaxFreeListBytes = 1 << 20;
|
||||
#endif
|
||||
|
||||
// Maintains a free list up to kMaxFreeListBytes. If the top element of the list
|
||||
// doesn't meet the capacity constraints, it's freed and a new node is allocated
|
||||
@@ -729,6 +734,8 @@ template <class T> struct NodeAllocator {
|
||||
}
|
||||
|
||||
void release(T *p) {
|
||||
assume(p->partialKeyCapacity >= 0);
|
||||
assume(freeListSize >= 0);
|
||||
if (freeListSize + sizeof(T) + p->partialKeyCapacity > kMaxFreeListBytes) {
|
||||
removeNode(p);
|
||||
return safe_free(p, sizeof(T) + p->partialKeyCapacity);
|
||||
|
||||
Reference in New Issue
Block a user