Skip to content

Commit

Permalink
extern DEFAULT_ALLOCATION_FUNCTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Oct 9, 2024
1 parent b546afb commit 973031a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/common/stl_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace duckdb {

AllocationFunctions GetDefaultAllocationFunctions() {
static AllocationFunctions GetDefaultAllocationFunctions() {
AllocationFunctions result(nullptr, nullptr, nullptr);
#ifdef USE_JEMALLOC
result = JemallocExtension::GetAllocationFunctions();
Expand All @@ -25,4 +25,6 @@ AllocationFunctions GetDefaultAllocationFunctions() {
return result;
}

AllocationFunctions DEFAULT_ALLOCATION_FUNCTIONS = GetDefaultAllocationFunctions(); // NOLINT: non-const on purpose

} // namespace duckdb
3 changes: 1 addition & 2 deletions src/include/duckdb/common/stl_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class AllocationFunctions {
free_function_t free = nullptr;
};

DUCKDB_API AllocationFunctions GetDefaultAllocationFunctions();
static AllocationFunctions DEFAULT_ALLOCATION_FUNCTIONS = GetDefaultAllocationFunctions(); // NOLINT: non-const static
extern AllocationFunctions DEFAULT_ALLOCATION_FUNCTIONS; // NOLINT: non-const on purpose

template <class T>
T *stl_new_array_uninitialized(size_t size) { // NOLINT: not using camelcase on purpose here
Expand Down

0 comments on commit 973031a

Please sign in to comment.