JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
Memory.h File Reference
#include "JPLSpatial/Core.h"
#include "JPLSpatial/ErrorReporting.h"
#include <cstdlib>
#include <memory>
#include <type_traits>
#include <concepts>
#include <memory_resource>
#include <cstddef>

Go to the source code of this file.

Classes

class  JPL::ScopedGlobalMemoryResource
 RAII override library-wide default memory resource. More...
 
struct  JPL::AllocatorDeleter< T, AllocatorType >
 
class  JPL::PmrDeleter< T >
 
class  JPL::CountingResource
 
class  JPL::Mallocator
 
class  JPL::PmrMallocResource
 

Namespaces

namespace  JPL
 
namespace  JPL::Internal
 

Typedefs

template<class T >
using JPL::PmrAllocator = std::pmr::polymorphic_allocator< T >
 Just a shorter alias.
 
template<class T >
using JPL::pmr_unique_ptr = std::unique_ptr< T, PmrDeleter< T > >
 Alias for unique ptr using pmr allocator and deleter.
 

Functions

std::pmr::memory_resource * JPL::GetDefaultMemoryResource () noexcept
 
template<class T , class Allocator , class... Args>
auto JPL::allocate_unique (const Allocator &allocator, Args &&... args)
 
template<class T = std::byte>
JPL_INLINE PmrAllocator< T > JPL::GetDefaultPmrAllocator ()
 
template<class T , class ... Args>
JPL_INLINE T * JPL::DefaultNew (Args &&...args)
 Allocate new object from deafult global memory resource used in JPLSpatial.
 
template<class T >
JPL_INLINE void JPL::DefaultDelete (T *object)
 Delete object allcoated from deafult global memory resource. The object must had been allocated by calling DefaultNew
 
template<class T , class... Args>
JPL_INLINE std::shared_ptr< T > JPL::make_pmr_shared (Args &&... args)
 std::make_shared wrapper using our global memory resource
 
template<class T >
JPL_INLINE std::shared_ptr< T > JPL::make_pmr_shared (T *ptr)
 
template<class T , class Y >
JPL_INLINE void JPL::reset_pmr_shared (std::shared_ptr< T > &sharedPtr, Y *ptr)
 
template<class T >
JPL_INLINE void JPL::reset_pmr_shared (std::shared_ptr< T > &sharedPtr)
 
template<class T , class... Args>
JPL_INLINE pmr_unique_ptr< T > JPL::make_pmr_unique (Args &&... args)
 std::make_unique wrapper using our global memory resource
 

Variables

std::pmr::memory_resource * JPL::gDefaultMemoryResource = std::pmr::get_default_resource()