12 // loop to first increase, then decrease
13 for (inc_dec
= 1; inc_dec
>= -1; inc_dec
-=2) {
14 // loop to increase(decrease) with small then big delta
15 for (delta
= 1; delta
<= 400; delta
+=399) {
16 if (0) printf("initial brk value for inc_dec %d delta %d: %p\n",
17 inc_dec
, delta
, sbrk(0));
18 for (i
=0; i
<MAX
; i
++) {
19 brk_stat
= (intptr_t)brk(sbrk(0) + inc_dec
* delta
);
21 printf("brk value at failure: %p\n", sbrk(0));
22 perror ("brk() failed!\n");
26 if (0) printf("resulting brk value for inc_dec %d delta %d: %p\n",
27 inc_dec
, delta
, sbrk(0));