Abstracted away from x86 intrinsics

This commit is contained in:
tevador
2019-05-14 09:13:38 +02:00
parent 3dd21ea93d
commit 1aa7865619
10 changed files with 267 additions and 249 deletions
+2 -3
View File
@@ -27,7 +27,7 @@ namespace randomx {
template<size_t alignment>
void* AlignedAllocator<alignment>::allocMemory(size_t count) {
void *mem = _mm_malloc(count, alignment);
void *mem = rx_aligned_alloc(count, alignment);
if (mem == nullptr)
throw std::bad_alloc();
return mem;
@@ -35,11 +35,10 @@ namespace randomx {
template<size_t alignment>
void AlignedAllocator<alignment>::freeMemory(void* ptr, size_t count) {
_mm_free(ptr);
rx_aligned_free(ptr);
}
template class AlignedAllocator<CacheLineSize>;
template class AlignedAllocator<sizeof(__m128i)>;;
void* LargePageAllocator::allocMemory(size_t count) {
return allocLargePagesMemory(count);