File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 11[submodule "benchmark/vendor/benchmark "]
22 path = third_party/benchmark
3- url = https://github.com/Matazure /benchmark.git
3+ url = https://github.com/matazure /benchmark.git
44[submodule "test/vendor/googletest "]
55 path = third_party/googletest
6- url = https://github.com/Matazure /googletest.git
6+ url = https://github.com/matazure /googletest.git
77[submodule "third_party/stb "]
88 path = third_party/stb
99 url = https://github.com/nothings/stb.git
Original file line number Diff line number Diff line change 11#pragma once
22
3+ #ifdef __APPLE__
34#include < stdlib.h>
5+ #else
6+ #include < malloc.h>
7+ #endif
8+
49#include < matazure/config.hpp>
510
611namespace matazure {
@@ -13,11 +18,13 @@ class aligned_allocator : public std::allocator<_Type> {
1318 aligned_allocator& operator =(const aligned_allocator& rhs) { return *this ; }
1419
1520 _Type* allocate (size_t size) {
21+ #ifdef __GNUC__
1622 _Type* data = nullptr ;
17- #ifdef __WIN32
18- data = reinterpret_cast <_Type*>(_aligned_malloc (size * sizeof (_Type), _Alignment));
23+ posix_memalign (reinterpret_cast <void **>(&data), _Alignment, size * sizeof (_Type));
24+ MATAZURE_ASSERT (data != nullptr , " Failed to alloc align memory" );
25+ // _Type* data = reinterpret_cast<_Type*>(memalign(_Alignment, size * sizeof(_Type)));
1926#else
20- posix_memalign (reinterpret_cast <void **>(&data), _Alignment, size * sizeof (_Type));
27+ posix_memalign (reinterpret_cast <void **>(&data), _Alignment, size * sizeof (_Type));
2128#endif
2229 return data;
2330 }
Original file line number Diff line number Diff line change 1+ mkdir -p build
2+ cd build
3+ cmake .. $@
4+
5+ starttime=` date +' %Y-%m-%d %H:%M:%S' `
6+
7+ cmake --build . -- -j|| exit 1
You can’t perform that action at this time.
0 commit comments