gs-vertex, util-math: Use _aligned_malloc instead of util::malloc_aligned

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-01-08 17:40:04 +01:00
parent 1993c42ea6
commit 8a595501b3
2 changed files with 15 additions and 13 deletions

View file

@ -19,6 +19,7 @@
#include "gs-vertexbuffer.h"
#include "util-memory.h"
#include <malloc.h>
GS::Vertex& GS::Vertex::operator=(const Vertex& r) {
vec3_copy(&this->position, &r.position);
@ -41,7 +42,7 @@ GS::Vertex* GS::Vertex::operator=(const Vertex* r) {
}
void* GS::Vertex::operator new(size_t count) {
return util::malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void* GS::Vertex::operator new(size_t count, void* d){
@ -49,7 +50,7 @@ void* GS::Vertex::operator new(size_t count, void* d){
}
void* GS::Vertex::operator new[](size_t count) {
return util::malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void* GS::Vertex::operator new[](size_t count, void* d) {
@ -57,9 +58,9 @@ void* GS::Vertex::operator new[](size_t count, void* d) {
}
void GS::Vertex::operator delete(void* p) {
return util::free_aligned(p);
return _aligned_free(p);
}
void GS::Vertex::operator delete[](void* p) {
return util::free_aligned(p);
return _aligned_free(p);
}

View file

@ -19,35 +19,36 @@
#include "util-math.h"
#include "util-memory.h"
#include <malloc.h>
void* util::vec3a::operator new(size_t count){
return malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void* util::vec3a::operator new[](size_t count) {
return malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void util::vec3a::operator delete(void* p) {
free_aligned(p);
_aligned_free(p);
}
void util::vec3a::operator delete[](void* p) {
free_aligned(p);
_aligned_free(p);
}
void* util::vec4a::operator new(size_t count){
return malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void* util::vec4a::operator new[](size_t count) {
return malloc_aligned(16, count);
return _aligned_malloc(count, 16);
}
void util::vec4a::operator delete(void* p) {
free_aligned(p);
_aligned_free(p);
}
void util::vec4a::operator delete[](void* p) {
free_aligned(p);
_aligned_free(p);
}