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 made a simple logger for my OS to make the debugging process easier. (I'm at a stage where I don't even have the IDT set up for all IRQs and exceptions, let alone new and delete)
Whenever I try to add a virtual destructor it results in an undefined reference to operator delete.
I can obviously add a stub, but why does it even need operator delete here? What is it trying to delete?
It compiles and links successfully when I remove the virtual destructor (which is also fine I guess).
In short, the ABI requires the compiler to generate that function call for all virtual destructors, but it will only be called if you use new/delete to create/destroy an object of that class. Since you're not going to do that, it should never be called.
Since it should never be called, your stub operator delete can call your kernel's panic handler to halt and inform you that something bad happened.
In short, the ABI requires the compiler to generate that function call for all virtual destructors, but it will only be called if you use new/delete to create/destroy an object of that class. Since you're not going to do that, it should never be called.
Since it should never be called, your stub operator delete can call your kernel's panic handler to halt and inform you that something bad happened.