| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| For pure helper classes that also live in the same module, it is safe to use new to create a new one. If you want to be more sophisticated you can override the operator new()/delete() functions too, see xnu/libkern/c++/OSObject.cpp If you do decide to go with an OSObject subclass then remember there is a big drawback, which is that you can not use the same class name in 2 loaded kernel extensions. So if you bundle your helper class in the same executable as each HAL then one or other of your drivers will fail to load on a duplicate class name. In summary, pure C++ objects are allowed within the kernel. • If you live within one kext bundle then new is always safe. • If you try to cross kext boundaries then create static 'factory' methods gives some independence from fragile base class issues, though remember there are other C++ ABI issues. OSObject tries to address these issues but it is a bit of a kludge. Godfrey On 06/02/2005, at 14:53 , Parav Pandit wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-drivers/email@hidden This email sent to email@hidden
| References: | |
| >Re: helper class instance creation (From: Parav Pandit <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.