1 /* PR target/10067 */ 2 /* Originator: <dat94ali@ludat.lth.se> */ 3 /* { dg-do compile { target sparc*-*-* } } */ 4 /* { dg-options "-O2 -mtune=supersparc" { target sparc64-*-* sparcv9-*-* } } */ 5 6 struct _reent; 7 8 extern unsigned long __malloc_trim_threshold; 9 extern unsigned long __malloc_top_pad; 10 _mallopt_r(struct _reent * reent_ptr,int param_number,int value)11int _mallopt_r(struct _reent *reent_ptr, int param_number, int value) 12 { 13 __malloc_lock(reent_ptr); 14 15 switch(param_number) 16 { 17 case -1: 18 __malloc_trim_threshold = value; 19 __malloc_unlock(reent_ptr); 20 return 1; 21 22 case -2: 23 __malloc_top_pad = value; 24 __malloc_unlock(reent_ptr); 25 return 1; 26 27 case -3: 28 __malloc_unlock(reent_ptr); 29 return 1; 30 31 case -4: 32 __malloc_unlock(reent_ptr); 33 return value == 0; 34 35 default: 36 __malloc_unlock(reent_ptr); 37 return 0; 38 } 39 } 40