Hi,

you can also take a look at my implementation:

https://github.com/Ingrater/druntime/blob/master/src/core/allocator.d

Look at AllocatorNew and AllocatorDelete

Especially important is, that you correctly handle the constructor throwing an exception. You have to catch that exception in your new function, release the memory and rethrow.

Kind Regards
Benjamin Thaut

Reply via email to