mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06:45 +08:00
just use default policy for chunk_variable_alloc
This commit is contained in:
parent
449bc36bd9
commit
3d46bcd47a
@ -17,27 +17,7 @@
|
||||
namespace ipc {
|
||||
namespace mem {
|
||||
|
||||
template <std::size_t Size>
|
||||
using static_sync_fixed = static_wrapper<async_wrapper<fixed_alloc<Size, static_alloc>>>;
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct chunk_mapping_policy {
|
||||
|
||||
enum : std::size_t {
|
||||
base_size = sizeof(void*) * 1024 * 1024, /* 8MB(x64) */
|
||||
classes_size = 1
|
||||
};
|
||||
|
||||
constexpr static std::size_t classify(std::size_t size) {
|
||||
return (size <= base_size) ? 0 : static_cast<std::size_t>(classes_size);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
using static_chunk_alloc = variable_wrapper<static_sync_fixed, detail::chunk_mapping_policy>;
|
||||
using chunk_variable_alloc = variable_alloc<detail::chunk_mapping_policy::base_size, static_chunk_alloc>;
|
||||
using chunk_variable_alloc = variable_alloc<sizeof(void*) * 1024 * 1024 /* 8MB(x64) */>;
|
||||
|
||||
template <std::size_t Size>
|
||||
using static_async_fixed = static_wrapper<async_wrapper<fixed_alloc<Size, chunk_variable_alloc>>>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user