aboutsummaryrefslogtreecommitdiff
path: root/src/OwnedMemory.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-14 19:45:15 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit414f2cafc6cf2fe141c011b0d63d447a9b983ac3 (patch)
treea0d53ca898b8586e7be97689fcb993d5405d08a0 /src/OwnedMemory.cpp
parent53a1850ce2a253c574113684ac38c8ed31b1d0ae (diff)
Store database storage to files, also loading
Diffstat (limited to 'src/OwnedMemory.cpp')
-rw-r--r--src/OwnedMemory.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/OwnedMemory.cpp b/src/OwnedMemory.cpp
new file mode 100644
index 0000000..1d53faf
--- /dev/null
+++ b/src/OwnedMemory.cpp
@@ -0,0 +1,21 @@
+#include "../include/odhtdb/OwnedMemory.hpp"
+#include <cstdlib>
+
+namespace odhtdb
+{
+ OwnedMemory::OwnedMemory(OwnedMemory &&other)
+ {
+ data = other.data;
+ size = other.size;
+
+ other.data = nullptr;
+ other.size = 0;
+ }
+
+ OwnedMemory::~OwnedMemory()
+ {
+ free(data);
+ data = nullptr;
+ size = 0;
+ }
+}