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

@@ -1,4 +1,5 @@
#include "FileSectionStream.h"
#include "PLCore.h"
#include <stdlib.h>
#include <new>
@@ -151,7 +152,7 @@ namespace PortabilityLayer
void FileSectionStreamImpl::GP_ASYNCIFY_PARANOID_NAMED(Close)()
{
this->~FileSectionStreamImpl();
free(this);
DisposePtr(this);
}
void FileSectionStreamImpl::Flush()
@@ -161,7 +162,7 @@ namespace PortabilityLayer
GpIOStream *FileSectionStream::Create(GpIOStream *stream, GpUFilePos_t start, GpUFilePos_t size)
{
void *storage = malloc(sizeof(FileSectionStreamImpl));
void *storage = NewPtr(sizeof(FileSectionStreamImpl));
if (!storage)
return nullptr;