exit(1);
}
+#define SZ 32
+
extern char *optarg;
extern int opterr;
gettimeofday(&begin, NULL);
base = allocMemoryContext(NULL, MC_DEBUG);
for(i=0;i<count;i++) {
- ptr = mcalloc(base, 1+random()%1024 );
- ptr1 = mcalloc(base, 1+random()%1024 );
+ ptr = mcalloc(base, 1+random()%SZ );
+ ptr1 = mcalloc(base, 1+random()%SZ );
if ( !(ptr && ptr1) )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = i%256;
*ptr1 = i%256;
mcfree(ptr1);
- ptr = mcrealloc(ptr, 1+random()%1024 );
+ ptr = mcrealloc(ptr, 1+random()%SZ );
if ( !ptr )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = (i+1)%256;
- ptr1=mcalloc(base, 1+random()%1024 );
+ ptr1=mcalloc(base, 1+random()%SZ );
*ptr1 = (i+2)%256;
- ptr = mcrealloc(ptr, 1+random()%1024 );
+ ptr = mcrealloc(ptr, 1+random()%SZ );
if ( !ptr )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = (i+3)%256;
} else {
gettimeofday(&begin, NULL);
for(i=0;i<count;i++) {
- ptr = malloc( 1+random()%1024 );
- ptr1 = malloc( 1+random()%1024 );
+ ptr = malloc( 1+random()%SZ );
+ ptr1 = malloc( 1+random()%SZ );
if ( !(ptr && ptr1) )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = i%256;
*ptr1 = i%256;
free(ptr1);
- ptr = realloc(ptr, 1+random()%1024 );
+ ptr = realloc(ptr, 1+random()%SZ );
if ( !ptr )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = (i+1)%256;
- ptr1=malloc( 1+random()%1024 );
+ ptr1=malloc( 1+random()%SZ );
*ptr1 = (i+2)%256;
- ptr = realloc(ptr, 1+random()%1024 );
+ ptr = realloc(ptr, 1+random()%SZ );
if ( !ptr )
tlog(TL_CRIT|TL_EXIT,"No memory");
*ptr = (i+3)%256;