21#ifndef __ANTARES_LIBS_MEMORY_MEMORY_H__
22#define __ANTARES_LIBS_MEMORY_MEMORY_H__
25#include <yuni/core/bit/array.h>
26#include <yuni/core/string.h>
33class Memory final:
public Yuni::Policy::ObjectLevelLockable<Memory>
40 using ReturnType = T*;
41 using ConstReturnType =
const T*;
43 static const T* NullValue()
50 static U* RawPointer(U* array);
53 static void Zero(uint count, U* array);
56 static void Assign(uint count, U* array,
const U& value);
59 static void Allocate(T*& out,
size_t size);
62 static bool Null(
const T* out);
65 static bool StrictNull(
const T* out);
71 static void Release(T*& pointer);
85 bool initializeTemporaryFolder();
111 Yuni::String pCacheFolder;
113 bool pAllowedToChangeCacheFolder;
119 bool pAlreadyInitialized =
false;
Custom memory allocator for managed pointers.
Definition memory.h:34
Memory()=default
Default Constructor.
const Yuni::String & cacheFolder() const
\nane Cache Folder
Definition memory.cpp:137
~Memory()=default
Destructor.
static void Release(T *&pointer)
Release a raw pointer.
Definition memory.hxx:32
void displayInfo() const
Display infos into the logs.
Definition memory.cpp:122
uint64_t processID() const
Get the process ID of the application.
Definition memory.hxx:26