MCPcopy Create free account
hub / github.com/PX4/eigen / check_handmade_aligned_malloc

Function check_handmade_aligned_malloc

test/dynalloc.cpp:20–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

test_dynallocFunction · 0.85

Calls 2

handmade_aligned_mallocFunction · 0.85
handmade_aligned_freeFunction · 0.85

Tested by 1

test_dynallocFunction · 0.68