Allocator refactor

This commit is contained in:
elasota
2021-04-28 01:46:07 -04:00
parent 472462c535
commit a2d374f650
75 changed files with 473 additions and 253 deletions

View File

@@ -2,6 +2,7 @@
#include "IGpThreadEvent.h"
#include "IGpSystemServices.h"
#include "PLCore.h"
#include "PLDrivers.h"
#include <stdlib.h>
@@ -39,7 +40,7 @@ namespace PortabilityLayer
void PortabilityLayer::WorkerThreadImpl::Destroy()
{
this->~WorkerThreadImpl();
free(this);
DisposePtr(this);
}
void PortabilityLayer::WorkerThreadImpl::AsyncExecuteTask(PortabilityLayer::WorkerThread::Callback_t callback, void *context)
@@ -139,7 +140,7 @@ PortabilityLayer::WorkerThread::~WorkerThread()
PortabilityLayer::WorkerThread *PortabilityLayer::WorkerThread::Create()
{
void *storage = malloc(sizeof(PortabilityLayer::WorkerThreadImpl));
void *storage = NewPtr(sizeof(PortabilityLayer::WorkerThreadImpl));
if (!storage)
return nullptr;