Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-15 Thread Joerg Sonnenberger
On Thu, Jun 14, 2007 at 06:04:27PM -0700, Matthew Dillon wrote: > From this point of view it is much, much better to bzero() memory that > is already mapped then it is to map/unmap new memory. For kernel land, you are right. For userland, there's one big down-side to always bzero/memset ne

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-14 Thread youshi10
On Thu, 14 Jun 2007, Matthew Dillon wrote: I'm going to throw a wrench in the works, because it all gets turned around the moment you find yourself in a SMP environment where several threads are running on different cpus at the same time, using the same shared VM space. The momen

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-14 Thread Matthew Dillon
I'm going to throw a wrench in the works, because it all gets turned around the moment you find yourself in a SMP environment where several threads are running on different cpus at the same time, using the same shared VM space. The moment you have a situation like that where y

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-14 Thread Ivan Voras
[EMAIL PROTECTED] wrote: > Do you know if that's with malloc or calloc? What portion of the source > demonstrates this? No source, but here's a quote from http://boredzo.org/blog/archives/2006-11-26/calloc-vs-malloc: For large blocks (where "large" is surprisingly small, something like 14 KB) Ma

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-14 Thread youshi10
On Thu, 14 Jun 2007, Ivan Voras wrote: [EMAIL PROTECTED] wrote: Hmmm... I wonder what the Mach kernel in OSX does to allocate memory then. I'll have to take a look at OpenDarwin's source sometime and see what it does. Following the link chain from the benchmark link posted in this thread I'v

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-14 Thread Ivan Voras
[EMAIL PROTECTED] wrote: > Hmmm... I wonder what the Mach kernel in OSX does to allocate memory > then. I'll have to take a look at OpenDarwin's source sometime and see > what it does. Following the link chain from the benchmark link posted in this thread I've come to the information that it's si

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Ed Schouten wrote: * Garrett Cooper <[EMAIL PROTECTED]> wrote: Garrett Cooper wrote: Title says it all -- is there a particular reason why malloc/bzero should be used instead of calloc? -Garrett As someone just brought to my attention, I should do some Googling. In

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread Ed Schouten
* Garrett Cooper <[EMAIL PROTECTED]> wrote: > Garrett Cooper wrote: > >Title says it all -- is there a particular reason why malloc/bzero > > should be used instead of calloc? > > -Garrett > As someone just brought to my attention, I should do some Googling. > > Initial results brought up

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread Garrett Cooper
Garrett Cooper wrote: Title says it all -- is there a particular reason why malloc/bzero should be used instead of calloc? -Garrett As someone just brought to my attention, I should do some Googling. Initial results brought up this: