MySQL 9.0.0
Source Code Documentation
temptable::Memory< Source::RAM > Struct Reference

Template specialization for RAM-based allocation/deallocation. More...

#include <memutils.h>

Static Public Member Functions

static void * allocate (size_t bytes)
 Allocates memory from RAM. More...
 
static void deallocate (void *ptr, size_t bytes)
 Deallocates memory from RAM. More...
 

Static Private Member Functions

static void * fetch (size_t bytes)
 
static void drop (void *ptr, size_t bytes)
 

Static Private Attributes

static const bool linux_numa_available = numa_available() != -1
 Set to true if Linux's numa_available() reports "available" (!= -1). More...
 

Detailed Description

Template specialization for RAM-based allocation/deallocation.

Member Function Documentation

◆ allocate()

static void * temptable::Memory< Source::RAM >::allocate ( size_t  bytes)
inlinestatic

Allocates memory from RAM.

Linux:

  • If support for NUMA is compiled in, and NUMA is available on the platform, NUMA allocation will be used.
  • If support for NUMA is compiled in, but NUMA is NOT available on the platform, non-NUMA allocation will be used (fallback to e.g. malloc). Windows:
  • If support for NUMA is compiled in, NUMA allocation will be used.

Throws Result::OUT_OF_MEM if allocation was unsuccessful.

[in] Size of the memory to be allocated.

Returns
Pointer to allocated memory.

◆ deallocate()

static void temptable::Memory< Source::RAM >::deallocate ( void *  ptr,
size_t  bytes 
)
inlinestatic

Deallocates memory from RAM.

[in] Pointer to the memory to be deallocated.. [in] Size of the memory to be deallocated.

◆ drop()

void temptable::Memory< Source::RAM >::drop ( void *  ptr,
size_t  bytes 
)
inlinestaticprivate

◆ fetch()

void * temptable::Memory< Source::RAM >::fetch ( size_t  bytes)
inlinestaticprivate

Member Data Documentation

◆ linux_numa_available

const bool temptable::Memory< Source::RAM >::linux_numa_available = numa_available() != -1
staticprivate

Set to true if Linux's numa_available() reports "available" (!= -1).


The documentation for this struct was generated from the following files: