MCPcopy Create free account
hub / github.com/Derious/cuMPC / check_handmade_aligned_malloc

Function check_handmade_aligned_malloc

dependence/eigen-3.4.0/test/dynalloc.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19typedef Matrix<float,8,1> Vector8f;
20
21void check_handmade_aligned_malloc()
22{
23 for(int i = 1; i < 1000; i++)
24 {
25 char *p = (char*)internal::handmade_aligned_malloc(i);
26 VERIFY(internal::UIntPtr(p)%ALIGNMENT==0);
27 // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
28 for(int j = 0; j < i; j++) p[j]=0;
29 internal::handmade_aligned_free(p);
30 }
31}
32
33void check_aligned_malloc()
34{

Callers 1

EIGEN_DECLARE_TESTFunction · 0.85

Calls 2

handmade_aligned_mallocFunction · 0.85
handmade_aligned_freeFunction · 0.85

Tested by

no test coverage detected