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

Function check_aligned_malloc

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

Source from the content-addressed store, hash-verified

31}
32
33void check_aligned_malloc()
34{
35 for(int i = ALIGNMENT; i < 1000; i++)
36 {
37 char *p = (char*)internal::aligned_malloc(i);
38 VERIFY(internal::UIntPtr(p)%ALIGNMENT==0);
39 // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
40 for(int j = 0; j < i; j++) p[j]=0;
41 internal::aligned_free(p);
42 }
43}
44
45void check_aligned_new()
46{

Callers 1

EIGEN_DECLARE_TESTFunction · 0.85

Calls 2

aligned_mallocFunction · 0.85
aligned_freeFunction · 0.85

Tested by

no test coverage detected