mirror of
https://github.com/jorio/Pomme.git
synced 2025-02-17 07:32:11 +00:00
Implement NewPtrClear
This commit is contained in:
parent
a082592eab
commit
b7ee239eb2
@ -102,6 +102,14 @@ Ptr NewPtrSys(Size byteCount)
|
||||
return new char[byteCount];
|
||||
}
|
||||
|
||||
Ptr NewPtrClear(Size byteCount)
|
||||
{
|
||||
if (byteCount < 0) throw std::invalid_argument("trying to NewPtrClear negative size");
|
||||
Ptr ptr = new char[byteCount];
|
||||
memset(ptr, 0, byteCount);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void DisposePtr(Ptr p)
|
||||
{
|
||||
delete[] p;
|
||||
|
@ -312,6 +312,8 @@ Ptr NewPtr(Size);
|
||||
|
||||
Ptr NewPtrSys(Size);
|
||||
|
||||
Ptr NewPtrClear(Size);
|
||||
|
||||
void DisposePtr(Ptr p);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user