Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I've already implemented a malloc and free functions. Since I'm creating a C++ kernel, now I need to implement new and delete too...
Initially I thinked that
Is the only think I need. But I read that new and delete also call constructors and deconstructors. How can I call the contructor of the new class?
I also read that the return type of new isn't void * but a pointer to the type of the parameter.
Eg
Use of operator new and delete automatically calls the constructors and destructors, you don't need to do that in your implementation.
And yes, the return type automatically gets converted to a pointer to the type being allocated. Also, your usage of new in that example is wrong - new takes a type as a parameter, not a size. It should be: