MySQL 9.0.0
Source Code Documentation
ut::detail::Alloc Struct Reference

Allocation routines for non-extended alignment types, as opposed to Aligned_alloc for example. More...

#include <alloc.h>

Inheritance diagram for ut::detail::Alloc:
[legend]

Static Public Member Functions

template<bool Zero_initialized>
static void * alloc (std::size_t size) noexcept
 Dynamically allocates storage of given size. More...
 
static void * realloc (void *ptr, std::size_t size) noexcept
 Reallocates the given area of memory. More...
 
static void free (void *ptr) noexcept
 Releases storage dynamically allocated through Alloc::alloc() or Alloc::realloc(). More...
 

Additional Inherited Members

- Static Public Attributes inherited from ut::detail::allocator_traits< false >
static constexpr auto is_pfs_instrumented_v
 

Detailed Description

Allocation routines for non-extended alignment types, as opposed to Aligned_alloc for example.

These are only a mere wrappers around standard allocation routines so memory layout representation doesn't look any other than the following:


| ... DATA ... |

^ | | ptr to be returned to call-site

DATA segment is a segment that will be returned to the call-site.

Member Function Documentation

◆ alloc()

template<bool Zero_initialized>
static void * ut::detail::Alloc::alloc ( std::size_t  size)
inlinestaticnoexcept

Dynamically allocates storage of given size.

Parameters
[in]sizeSize of storage (in bytes) requested to be allocated.
Returns
Pointer to the allocated storage. nullptr if dynamic storage allocation failed.

◆ free()

static void ut::detail::Alloc::free ( void *  ptr)
inlinestaticnoexcept

Releases storage dynamically allocated through Alloc::alloc() or Alloc::realloc().

Parameters
[in]ptrPointer to storage allocated through Alloc::alloc() or Alloc::realloc()

◆ realloc()

static void * ut::detail::Alloc::realloc ( void *  ptr,
std::size_t  size 
)
inlinestaticnoexcept

Reallocates the given area of memory.

Behaves as std::realloc() implementation on given platform.

Parameters
[in]ptrPointer to the memory to be reallocated.
[in]sizeNew size of storage (in bytes) requested to be allocated.
Returns
Pointer to the reallocated storage. Or nullptr if realloc operation failed.

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