File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ add_library(catkit_core STATIC
3737 FreeListAllocator.cpp
3838 MessageBroker.cpp
3939 UuidGenerator.cpp
40+ LocalMemory.cpp
4041 proto/core.pb.cc
4142 proto/logging.pb.cc
4243 proto/testbed.pb.cc
Original file line number Diff line number Diff line change 1+ #include " LocalMemory.h"
2+
3+ LocalMemory::LocalMemory (std::size_t num_bytes)
4+ : m_Memory(new char [num_bytes])
5+ {
6+ }
7+
8+ LocalMemory::~LocalMemory ()
9+ {
10+ delete[] m_Memory;
11+ }
12+
13+ void *LocalMemory::GetAddress (std::size_t offset)
14+ {
15+ return m_Memory + offset;
16+ }
Original file line number Diff line number Diff line change 1+ #ifndef LOCAL_MEMORY_H
2+ #define LOCAL_MEMORY_H
3+
4+ #include " Memory.h"
5+
6+ class LocalMemory : public Memory
7+ {
8+ public:
9+ LocalMemory (std::size_t num_bytes);
10+ virtual ~LocalMemory ();
11+
12+ virtual void *GetAddress (std::size_t offset = 0 );
13+
14+ private:
15+ char *m_Memory;
16+ };
17+
18+ #endif // LOCAL_MEMORY_H
You can’t perform that action at this time.
0 commit comments