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

Function check_aligned_malloc

test/dynalloc.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

test_dynallocFunction · 0.85

Calls 2

aligned_mallocFunction · 0.85
aligned_freeFunction · 0.85

Tested by 1

test_dynallocFunction · 0.68