Rename slab_allocator to chunk_allocator

This commit is contained in:
Matthew Parkinson
2021-10-20 11:12:09 +01:00
committed by Matthew Parkinson
parent 342d826310
commit 4a7cd268f8
7 changed files with 17 additions and 17 deletions

View File

@@ -1,9 +1,9 @@
#pragma once
#include "../backend/backend.h"
#include "../mem/chunkallocator.h"
#include "../mem/corealloc.h"
#include "../mem/pool.h"
#include "../mem/slaballocator.h"
#include "commonconfig.h"
namespace snmalloc
@@ -19,15 +19,15 @@ namespace snmalloc
private:
using Backend = BackendAllocator<PAL, true>;
inline static ChunkAllocatorState slab_allocator_state;
inline static ChunkAllocatorState chunk_allocator_state;
inline static GlobalPoolState alloc_pool;
public:
static ChunkAllocatorState&
get_slab_allocator_state(typename Backend::LocalState*)
get_chunk_allocator_state(typename Backend::LocalState*)
{
return slab_allocator_state;
return chunk_allocator_state;
}
static GlobalPoolState& pool()

View File

@@ -1,9 +1,9 @@
#pragma once
#include "../backend/backend.h"
#include "../mem/chunkallocator.h"
#include "../mem/corealloc.h"
#include "../mem/pool.h"
#include "../mem/slaballocator.h"
#include "commonconfig.h"
#ifdef SNMALLOC_TRACING
@@ -37,7 +37,7 @@ namespace snmalloc
private:
using Backend = BackendAllocator<Pal, false>;
SNMALLOC_REQUIRE_CONSTINIT
inline static ChunkAllocatorState slab_allocator_state;
inline static ChunkAllocatorState chunk_allocator_state;
SNMALLOC_REQUIRE_CONSTINIT
inline static GlobalPoolState alloc_pool;
@@ -50,9 +50,9 @@ namespace snmalloc
public:
static ChunkAllocatorState&
get_slab_allocator_state(Backend::LocalState* = nullptr)
get_chunk_allocator_state(Backend::LocalState* = nullptr)
{
return slab_allocator_state;
return chunk_allocator_state;
}
static GlobalPoolState& pool()

View File

@@ -88,7 +88,7 @@ namespace snmalloc
RemoteAllocator* remote)
{
ChunkAllocatorState& state =
SharedStateHandle::get_slab_allocator_state(&local_state);
SharedStateHandle::get_chunk_allocator_state(&local_state);
if (slab_sizeclass >= NUM_SLAB_SIZES)
{
@@ -140,7 +140,7 @@ namespace snmalloc
ChunkRecord* p,
size_t slab_sizeclass)
{
auto& state = SharedStateHandle::get_slab_allocator_state(&local_state);
auto& state = SharedStateHandle::get_chunk_allocator_state(&local_state);
#ifdef SNMALLOC_TRACING
std::cout << "Return slab:" << p->meta_common.chunk.unsafe_ptr()
<< " slab_sizeclass " << slab_sizeclass << " size "

View File

@@ -2,12 +2,12 @@
#include "../ds/defines.h"
#include "allocconfig.h"
#include "chunkallocator.h"
#include "localcache.h"
#include "metaslab.h"
#include "pool.h"
#include "remotecache.h"
#include "sizeclasstable.h"
#include "slaballocator.h"
namespace snmalloc
{

View File

@@ -3,8 +3,8 @@
#include "../ds/flaglock.h"
#include "../ds/mpmcstack.h"
#include "../pal/pal_concept.h"
#include "chunkallocator.h"
#include "pooled.h"
#include "slaballocator.h"
namespace snmalloc
{

View File

@@ -6,8 +6,8 @@ using namespace snmalloc;
void get_malloc_info_v1(malloc_info_v1* stats)
{
auto unused_chunks = Globals::get_slab_allocator_state().unused_memory();
auto peak = Globals::get_slab_allocator_state().peak_memory_usage();
auto unused_chunks = Globals::get_chunk_allocator_state().unused_memory();
auto peak = Globals::get_chunk_allocator_state().peak_memory_usage();
stats->current_memory_usage = peak - unused_chunks;
stats->peak_memory_usage = peak;
}

View File

@@ -25,7 +25,7 @@ namespace snmalloc
private:
using Backend = BackendAllocator<Pal, false>;
SNMALLOC_REQUIRE_CONSTINIT
inline static ChunkAllocatorState slab_allocator_state;
inline static ChunkAllocatorState chunk_allocator_state;
SNMALLOC_REQUIRE_CONSTINIT
inline static GlobalPoolState alloc_pool;
@@ -47,9 +47,9 @@ namespace snmalloc
();
static ChunkAllocatorState&
get_slab_allocator_state(Backend::LocalState* = nullptr)
get_chunk_allocator_state(Backend::LocalState* = nullptr)
{
return slab_allocator_state;
return chunk_allocator_state;
}
static GlobalPoolState& pool()