new doing a zero memory ?
new doing a zero memory ?
- Subject: new doing a zero memory ?
- From: Francis Bouchard <email@hidden>
- Date: Fri, 21 Dec 2001 11:59:54 -0500
Hi, please tell me if this is not the right list.
I've been looking to know if the new in an IOKit of an object that does not
inherit from OSObject.
So I found in the sources (OSRuntime.cpp):
1 :void * operator new( size_t size)
2 :{
3 : void * result;
4 :
5 : result = (void *) kern_os_malloc( size);
6 : if( result)
7 : bzero( result, size);
8 : return( result);
9 :}
At line 7, it seems to do a zero memory. Is this not causing performance
drop ?
I found that because some of our old code rely on a new operator that is
initializing the data.
Is this initialization really necessary ?
Franics