/* Copyright (c) 2025 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Ullrich */ #pragma once #include #include #include #ifdef LEAN_MIMALLOC #include #endif namespace lean { // We do not override `new` to avoid FFI issues for users but use `lean::allocator` // explicitly where using the custom allocator is important. #ifdef LEAN_MIMALLOC template using allocator = mi_stl_allocator; #else template using allocator = std::allocator; #endif // `unordered_map/set` allocates per insert, so specializing to the custom allocator can // save significant time for maps with frequent inserts. template< class Key, class T, class Hash = std::hash, class KeyEqual = std::equal_to, class Allocator = lean::allocator> > using unordered_map = std::unordered_map; template< class Key, class Hash = std::hash, class KeyEqual = std::equal_to, class Allocator = lean::allocator > using unordered_set = std::unordered_set; };