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 "GpVOSEvent.h"
#include "GpWindows.h"
#include "IGpVOSEventQueue.h"
#include "IGpAllocator.h"
#include <stdlib.h>
#include <new>
@@ -72,8 +73,9 @@ void GpInputDriverXInput::ProcessInput()
void GpInputDriverXInput::Shutdown()
{
IGpAllocator *alloc = m_properties.m_alloc;
this->~GpInputDriverXInput();
free(this);
alloc->Release(this);
}
IGpPrefsHandler *GpInputDriverXInput::GetPrefsHandler() const
@@ -83,7 +85,7 @@ IGpPrefsHandler *GpInputDriverXInput::GetPrefsHandler() const
GpInputDriverXInput *GpInputDriverXInput::Create(const GpInputDriverProperties &props)
{
void *storage = malloc(sizeof(GpInputDriverXInput));
void *storage = props.m_alloc->Alloc(sizeof(GpInputDriverXInput));
if (!storage)
return nullptr;