njn | 7ce8311 | 2005-08-24 22:38:00 +0000 | [diff] [blame] | 1 | // In 3.0.0, Massif was badly broken on 64-bit platforms because it asked |
| 2 | // zero-sized redzones, and the allocator was forgetting to round the size |
| 3 | // up to sizeof(void*), which is the minimum. This caused bugs #111090 and |
| 4 | // #111285. This test is just a gentle allocation exercise which was |
| 5 | // failing. |
| 6 | |
| 7 | #include <stdlib.h> |
| 8 | #include <stdio.h> |
| 9 | |
| 10 | #define NN 100 |
| 11 | |
| 12 | int main(void) |
| 13 | { |
| 14 | int i; |
| 15 | char* a[NN]; |
| 16 | |
| 17 | for (i = i; i < NN; i++) { |
| 18 | a[i] = malloc(i); |
| 19 | } |
| 20 | |
| 21 | for (i = i; i < NN; i++) { |
| 22 | a[i] = realloc(a[i], NN - i); |
| 23 | } |
| 24 | |
| 25 | for (i = i; i < NN; i++) { |
| 26 | free(a[i]); |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |