LosaDev source snapshot 2019

This commit is contained in:
LosaDev committed 2026-11-07 13:30:45 +07:00
commit c198676e97
20588 files changed
+8812878

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <boost/pool/singleton_pool.hpp>
template<class T>
class BoostPooler
{
public:
static void* operator new(size_t size)
{
return boost::singleton_pool<T,sizeof(T),boost::default_user_allocator_new_delete,boost::details::pool::null_mutex>::malloc();
}
static void operator delete(void* p)
{
boost::singleton_pool<T,sizeof(T),boost::default_user_allocator_new_delete,boost::details::pool::null_mutex>::free(p);
}
};
template<class T>
class BoostPoolerL
{
public:
static void* operator new(size_t size)
{
return boost::singleton_pool<T,sizeof(T),boost::default_user_allocator_new_delete>::malloc();
}
static void operator delete(void* p)
{
boost::singleton_pool<T,sizeof(T),boost::default_user_allocator_new_delete>::free(p);
}
};