@@ -19,7 +19,9 @@ std::mutex indexMutex;
|
||||
class FlagGuard {
|
||||
public:
|
||||
explicit FlagGuard(std::atomic_bool& flag_)
|
||||
: flag(flag_) { flag = true; }
|
||||
: flag(flag_) {
|
||||
flag = true;
|
||||
}
|
||||
~FlagGuard() { flag = false; }
|
||||
|
||||
private:
|
||||
@@ -74,7 +76,7 @@ void AllocationIndex::reset() {
|
||||
|
||||
// static
|
||||
void* AllocationIndex::allocate(size_t size) {
|
||||
void *ptr = std::malloc(size);
|
||||
void* ptr = std::malloc(size);
|
||||
if (ptr && canModifyIndex()) addToIndex(size, ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user