Re: malloc_zone_batch_malloc
Re: malloc_zone_batch_malloc
- Subject: Re: malloc_zone_batch_malloc
- From: Eric Gouriou <email@hidden>
- Date: Wed, 21 May 2008 17:22:27 -0700
On May 21, 2008, at 5:19 PM, Eric Gouriou wrote:
On May 21, 2008, at 5:03 PM, Ariel Burton wrote:
The test program I included in my original
psoting, however, tries all sizes from 1 bytes
to 16mb without coming across a case where the
routine returns a non-zero value.
Am I missing something?
Non-zero means success (or partial success)
Oops, sorry I fail reading comprehension 101. Double-negatives are
hard, let's go shopping.
Eric
extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t
size, void **results, unsigned num_requested);
/* Allocates num blocks of the same size; Returns the number
truly allocated (may be 0) */
Eric
Ariel Burton
==
On Wed 21 May 16:37, Terry Lambert wrote:
On May 21, 2008, at 2:00 PM, Ariel Burton wrote:
In what circumstances is malloc_zone_batch_malloc
supposed to return any memory?
<http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html
"f your code allocates multiple, identically-sized memory blocks,
you
can use the malloc_zone_batch_malloc function to allocate those
blocks
all at once. This function offers better performance than the
equivalent series of calls to malloc to allocate the same memory.
Performance is best when the individual block size is relatively
small—
less than 4K in size. The function does its best to allocate all of
the requested memory but may return less than was requested. When
using this function, check the return values carefully to see how
many
blocks were actually allocated."
-- Terry
_______________________________________________
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
_______________________________________________
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