| 42 | } |
| 43 | |
| 44 | void check_aligned_new() |
| 45 | { |
| 46 | for(int i = ALIGNMENT; i < 1000; i++) |
| 47 | { |
| 48 | float *p = internal::aligned_new<float>(i); |
| 49 | VERIFY(internal::UIntPtr(p)%ALIGNMENT==0); |
| 50 | // if the buffer is wrongly allocated this will give a bad write --> check with valgrind |
| 51 | for(int j = 0; j < i; j++) p[j]=0; |
| 52 | internal::aligned_delete(p,i); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | void check_aligned_stack_alloc() |
| 57 | { |
no outgoing calls