fix some typos and add placement new operator to AlignedAlloc

This commit is contained in:
Matthias Hochsteger 2016-11-04 12:48:23 +01:00
parent abde483216
commit 399d370463
2 changed files with 4 additions and 3 deletions

View File

@ -187,9 +187,9 @@ DLL_HEADER void ExportCSG(py::module &m)
.def(py::self-Vec<3>())
;
py::def ("Pnt", FunctionPointer
m.def ("Pnt", FunctionPointer
([](double x, double y, double z) { return global_trafo(Point<3>(x,y,z)); }));
py::def ("Pnt", FunctionPointer
m.def ("Pnt", FunctionPointer
([](double x, double y) { return Point<2>(x,y); }));
@ -229,7 +229,7 @@ DLL_HEADER void ExportCSG(py::module &m)
;
m.def ("Vec", FunctionPointer
([] (double x, double y, double z) { return global_trafo<3>(x,y,z); }));
([] (double x, double y, double z) { return global_trafo(Vec<3>(x,y,z)); }));
m.def ("Vec", FunctionPointer
([] (double x, double y) { return Vec<2>(x,y); }));

View File

@ -58,6 +58,7 @@ namespace netgen
class AlignedAlloc
{
public:
void * operator new (size_t s, void *p) { return p; }
void * operator new (size_t s) { return _mm_malloc(s, alignof(T)); }
void * operator new[] (size_t s) { return _mm_malloc(s, alignof(T)); }
void operator delete (void * p) { _mm_free(p); }