Zth (libzth)
Loading...
Searching...
No Matches
allocator.h File Reference
#include <libzth/macros.h>
#include <libzth/config.h>
#include <libzth/util.h>
#include <exception>
#include <list>
#include <map>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  zth::vector_type< T >
 std::vector type using Config::Allocator::type. More...
 
struct  zth::map_type< Key, T, Compare >
 std::map type using Config::Allocator::type. More...
 
struct  zth::list_type< T >
 std::list type using Config::Allocator::type. More...
 

Namespaces

namespace  zth
 

Macros

#define ZTH_MALLOC_INLINE   __attribute__((noinline))
 
#define ZTH_MALLOC_ATTR(attr)   __attribute__((malloc))
 
#define ZTH_CLASS_NEW_DELETE(T)
 Define new/delete operators for a class, which are allocator-aware.
 

Functions

template<typename T >
 zth::ZTH_MALLOC_ATTR ((malloc((void(*)(T *, size_t) noexcept) deallocate, 1), alloc_size(1))) static ZTH_MALLOC_INLINE T *allocate(size_t n
 Wrapper for Config::Allocator::type::allocate().
 
Arg zth::ZTH_MALLOC_ATTR ((malloc((void(*)(T *) noexcept) delete_alloc))) static ZTH_MALLOC_INLINE T *new _alloc(Arg const &arg)
 
template<typename T , typename... Arg>
 zth::ZTH_MALLOC_ATTR ((malloc((void(*)(T *) noexcept) delete_alloc))) static ZTH_MALLOC_INLINE T *new _alloc(Arg &&... arg)
 
template<typename Traits , typename Allocator >
string zth::to_zth_string (std::basic_string< char, Traits, Allocator > const &s)
 
std::string zth::to_std_string (string const &s)
 

Macro Definition Documentation

◆ ZTH_MALLOC_ATTR

#define ZTH_MALLOC_ATTR (   attr)    __attribute__((malloc))

Definition at line 32 of file allocator.h.

◆ ZTH_MALLOC_INLINE

#define ZTH_MALLOC_INLINE   __attribute__((noinline))

Definition at line 28 of file allocator.h.