On Fri, 6 Nov 2015, Piotr Caban wrote:
On 11/06/15 11:25, Martin Storsjö wrote:
Thanks, this does indeed seem to be implementable without too much effort in the end. The new/delete functions also seem to be pretty simple to reimplement based on malloc (which does the same msvcrt_heap_alloc(0, size) as MSVCRT_operator_new), _callnewh and free.
The hard part may be related to exception throwing in case of failure (I was not looking on it - it may be easy).
msvcp also seems to have a bad_alloc exception (the one in msvcrt isn't exposed in ucrtbase, where they seem to have removed most of all the C++ stuff that used to be in msvcrt), so it turned out to be as simple as throw_exception(EXCEPTION_BAD_ALLOC, "bad allocation"); instead of throw_bad_alloc("bad allocation");.
// Martin