mirror of
https://github.com/wownero/RandomWOW.git
synced 2026-10-18 07:51:36 +02:00
Don't use exceptions in low-level mem allocator
This commit is contained in:
+6
-3
@@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <new>
|
||||
#include "allocator.hpp"
|
||||
#include "intrin_portable.h"
|
||||
#include "virtual_memory.hpp"
|
||||
#include "virtual_memory.h"
|
||||
#include "common.hpp"
|
||||
|
||||
namespace randomx {
|
||||
@@ -50,11 +50,14 @@ namespace randomx {
|
||||
template struct AlignedAllocator<CacheLineSize>;
|
||||
|
||||
void* LargePageAllocator::allocMemory(size_t count) {
|
||||
return allocLargePagesMemory(count);
|
||||
void *mem = allocLargePagesMemory(count);
|
||||
if (mem == nullptr)
|
||||
throw std::bad_alloc();
|
||||
return mem;
|
||||
}
|
||||
|
||||
void LargePageAllocator::freeMemory(void* ptr, size_t count) {
|
||||
freePagedMemory(ptr, count);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user