diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-18 08:43:27 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-18 08:43:27 -0800 |
commit | 695d0e12950b9df248ea7b84f8434e32acc84f11 (patch) | |
tree | 69ac20d6a4681fe517033a8c9210d4996a91a5d1 /Source/Memory.h | |
parent | 133975b5a2ceca273182829f2f11042a5276c2f0 (diff) | |
download | witness-tutorializer-695d0e12950b9df248ea7b84f8434e32acc84f11.tar.gz witness-tutorializer-695d0e12950b9df248ea7b84f8434e32acc84f11.tar.bz2 witness-tutorializer-695d0e12950b9df248ea7b84f8434e32acc84f11.zip |
actually free memory
Diffstat (limited to 'Source/Memory.h')
-rw-r--r-- | Source/Memory.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Memory.h b/Source/Memory.h index 70a271e..79fbaba 100644 --- a/Source/Memory.h +++ b/Source/Memory.h | |||
@@ -41,9 +41,9 @@ public: | |||
41 | 41 | ||
42 | template <class T> | 42 | template <class T> |
43 | void WriteNewArray(int id, int offset, const std::vector<T>& data) { | 43 | void WriteNewArray(int id, int offset, const std::vector<T>& data) { |
44 | uintptr_t addr = VirtualAllocEx(_handle, nullptr, data.size() * sizeof(T), MEM_RESERVE | MEM_COMMIT, MEM_READWRITE); | 44 | uintptr_t addr = (uintptr_t)VirtualAllocEx(_handle, nullptr, data.size() * sizeof(T), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); |
45 | _allocations.emplace_back(addr); | 45 | _allocations.emplace_back(addr); |
46 | WriteEntityData(id, offset, addr); | 46 | WriteEntityData<uintptr_t>(id, offset, {addr}); |
47 | WriteArray(id, offset, data); | 47 | WriteArray(id, offset, data); |
48 | } | 48 | } |
49 | 49 | ||