tdslite latest
C++ API reference
Loading...
Searching...
No Matches
tdsl_allocator.hpp File Reference
#include <tdslite/util/tdsl_inttypes.hpp>
#include <tdslite/util/tdsl_type_traits.hpp>
#include <tdslite/util/tdsl_macrodef.hpp>
#include <tdslite/detail/tdsl_default_allocator.hpp>

Classes

struct  tdsl::placement_new_tag
 
struct  tdsl::mfctx
 
struct  tdsl::tds_allocator< T >
 

Namespaces

namespace  tdsl
 

Typedefs

using tdsl::malloc_fn_type = void *(*)(unsigned long)
 
using tdsl::free_fn_type = void(*)(void *ptr)
 

Functions

void * operator new (tdsl::size_t, void *p, tdsl::placement_new_tag) noexcept
 tdslite placement new
 
auto tdsl::tdslite_malloc_free (malloc_fn_type mfn=nullptr, free_fn_type ffn=nullptr) noexcept -> const mfctx &
 Set-get malloc & free functions for tdslite.
 
auto tdsl::tdslite_malloc (unsigned long n_bytes) noexcept -> void *
 
auto tdsl::tdslite_free (void *p, unsigned long n_bytes) noexcept -> void
 

Detailed Description


Author
mkg me@mu.nosp@m.staf.nosp@m.agilo.nosp@m.r.co.nosp@m.m
Date
29.09.2022

SPDX-License-Identifier: MIT


Function Documentation

◆ operator new()

void * operator new ( tdsl::size_t  ,
void *  p,
tdsl::placement_new_tag   
)
inlinenoexcept

tdslite placement new

Some platforms do not have <new> header in their standard libraries, hence, we're providing a placement new overload of our own. We're overloading the placement new because the standard prohibits overriding the original placement new functions.

Parameters
[in]pObject
Returns
p