Re: Is operator new safe?
Re: Is operator new safe?
- Subject: Re: Is operator new safe?
- From: chuck remes <email@hidden>
- Date: Tue, 22 Apr 2003 07:13:49 -0500
On Monday, April 21, 2003, at 09:57 PM, email@hidden wrote:
Is it safe to use the c++ operator new in a kernel extension?
I'm porting a file system library written in c++ to MacOS X, and I'm
getting a kernel panic when it calls new after performing a series of
I/Os, so I'm trying to determine whether the call to new is the
problem, or if I trashed memory when performing my I/O.
Take a look at page 64 of I/OKit Fundamentals (available from Apple at
http://developer.apple.com/techpubs/macosx/Darwin/General/
IOKitFundamentals/IOKitFundamentals.pdf ).
You may use new on any C++ object derived from OSObject, but there are
certain rules to follow as explained in that doc. The kernel runtime
environment only allows a very strict subset of C++, so exceptions and
RTTI (amongst other things) are not available which can make the
behavior of "new" a bit different from a userland application. If this
doesn't help, email me off the list and I'll try and explain further.
cr
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.