DriverKit provides IONewZero
and IOSafeDeleteNULL
. Those does not call any constructor or destructor.
Let's say that I would like to have some class in the ivars structure. The class does not need to inherit from OSObject
nor IOService
. How should I construct this object? If I have it as a member in the ivars
struct the constructor of my class is not called. If I keep a pointer to my class in the ivars structure I need to allocate and call the constructor of the class. Can I use new
/ delete
for this?