Hi, I just wanted to make this post more as an informative piece. I have begun to notice a LOT of people who attempt to write their Kernel in C++ (which requires extra code for the support of C++) do not completely understand how New and Delete work. They are NOT the same as just calling Malloc and Free. Let me explain.
In C++, the operator "new" does the following:
- Allocates memory for the storage of the object
- Calls the Class's constructor to setup the object
Therefore it should call malloc for the space it needs AND then it should call the object's Constructor.
The delete operator doesn't just call free either.
- Call the Class's DEconstructor to handle space cleanup
- Deallocate (or free) the memory that was used for storage of the class's instance.
Just calling malloc or free won't do everything that a Class type actually does, and you aren't using C++ in this case, you are just writing in C with the operators.
Now as of now I don't have a working model of this setup, but I am working on one and I will post more when I get it working flawlessly (and securely).