| 30 | } |
| 31 | |
| 32 | void 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 | |
| 44 | void check_aligned_new() |
| 45 | { |