Added StaticMemoryChunk class
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3830 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e90fa96289
commit
7e57ce9132
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "cpp.h"
|
#include "cpp.h"
|
||||||
|
|
||||||
namespace UDF {
|
namespace Udf {
|
||||||
|
|
||||||
/*! Simple class to encapsulate the boring details of allocating
|
/*! Simple class to encapsulate the boring details of allocating
|
||||||
and deallocating a chunk of memory.
|
and deallocating a chunk of memory.
|
||||||
@ -56,6 +56,17 @@ private:
|
|||||||
bool fOwnsData;
|
bool fOwnsData;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace UDF
|
template <uint32 size>
|
||||||
|
class StaticMemoryChunk {
|
||||||
|
public:
|
||||||
|
uint32 Size() { return size; }
|
||||||
|
void* Data() { return reinterpret_cast<void*>(fData); }
|
||||||
|
status_t InitCheck() { return B_OK; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint8 fData[size];
|
||||||
|
};
|
||||||
|
|
||||||
|
}; // namespace Udf
|
||||||
|
|
||||||
#endif // _UDF_MEMORY_CHUNK_H
|
#endif // _UDF_MEMORY_CHUNK_H
|
||||||
|
Loading…
Reference in New Issue
Block a user