headers/build: Replace StackOrHeapArray with a reference to the main one.

The files were identical. No functional change.
This commit is contained in:
Augustin Cavalier 2019-11-23 12:57:03 -05:00
parent f1304c1a4e
commit cb29eafe25

View File

@ -1,43 +1 @@
/*
* Copyright 2012, Jonathan Schleifer <js@webkeks.org>. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SUPPORT_STACKORHEAPARRAY_H
#define _SUPPORT_STACKORHEAPARRAY_H
#include <cstddef>
#include <new>
template <typename Type, int StackSize>
class BStackOrHeapArray {
public:
BStackOrHeapArray(size_t count)
{
if (count > StackSize)
fData = new(std::nothrow) Type[count];
else
fData = fStackData;
}
~BStackOrHeapArray()
{
if (fData != fStackData)
delete[] fData;
}
bool IsValid() const
{
return fData != NULL;
}
operator Type*()
{
return fData;
}
private:
Type fStackData[StackSize];
Type* fData;
};
#endif
#include <../os/support/StackOrHeapArray.h>