just use new/delete :^)

This commit is contained in:
Jeff Becker 2019-05-11 10:34:42 -04:00
parent f832c9a593
commit d2ef6fc77b
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 14 additions and 4 deletions

View File

@ -15,39 +15,49 @@ namespace llarp
AllocPool()
{
mem = new Memory();
mem = nullptr;
}
~AllocPool()
{
delete mem;
}
// delete mem;
}
Ptr_t
NewPtr()
{
/*
Ptr_t ptr = mem->allocate();
::new(ptr) Value_t;
return ptr;
*/
return new Value_t();
}
void
DelPtr(Ptr_t p)
{
/*
p->~Value_t();
mem->deallocate(p);
*/
delete p;
}
bool
Full() const
{
/*
return mem->full();
*/
return false;
}
bool
HasRoomFor(size_t numItems)
{
return mem->hasRoomFor(numItems);
return true;
/* return mem->hasRoomFor(numItems); */
}
private: