malloc_zone_batch_malloc
malloc_zone_batch_malloc
- Subject: malloc_zone_batch_malloc
- From: Ariel Burton <email@hidden>
- Date: Wed, 21 May 2008 17:00:10 -0400
In what circumstances is malloc_zone_batch_malloc
supposed to return any memory?
Please try the program I reproduce below.
Thanks,
Ariel Burton
==
#include <stdio.h>
#include <malloc/malloc.h>
static
size_t
do_experiment ( malloc_zone_t *z, size_t size_bound )
{
size_t ret_val = 0;
void *v [ 2 ];
unsigned int err;
size_t size;
for ( size = 1; (! ret_val) && (size < size_bound); size++ )
{
err = malloc_zone_batch_malloc ( z, size, v, 2 );
if ( 0 != err )
ret_val = size;
}
return ret_val;
} /* do_experiment */
int
main ( int argc, char *argv [] )
{
size_t size;
size_t size_bound = 16 * 1024 * 1024;
malloc_zone_t *z = malloc_default_zone ();
size = do_experiment ( z, size_bound );
printf ( "do_experiment to size %lu returned %lu\n",
(unsigned long) size_bound, (unsigned long) size );
return 0;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden