WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/dap/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class any {

static inline void* alignUp(void* val, size_t alignment);
inline void alloc(size_t size, size_t align);
inline void free();
inline void freeValue();
inline bool isInBuffer(void* ptr) const;

void* value = nullptr;
Expand Down Expand Up @@ -106,7 +106,7 @@ any::any(any&& other) noexcept : type(other.type) {
void any::reset() {
if (value != nullptr) {
type->destruct(value);
free();
freeValue();
}
value = nullptr;
type = nullptr;
Expand Down Expand Up @@ -191,7 +191,7 @@ void any::alloc(size_t size, size_t align) {
value = alignUp(heap, align);
}

void any::free() {
void any::freeValue() {
assert(value != nullptr);
if (heap != nullptr) {
delete[] reinterpret_cast<uint8_t*>(heap);
Expand Down