More tests:

-removed some unused code
-fixed bug with struct destructors (Mallocator called __dtor instead of __xdtor)
-added unittests for events
-addded _d_eh_personality null implementation as LDC betterC bug workaround
This commit is contained in:
Mergul 2020-04-18 19:16:45 +02:00
parent d0b7138f9f
commit cb9eaad123
5 changed files with 160 additions and 19 deletions

View file

@ -187,13 +187,15 @@ static struct Mallocator
static void dispose(T)(T object) nothrow @nogc
{
static if(__traits(hasMember, T, "__dtor"))object.__dtor();
static if(__traits(hasMember, T, "__xdtor"))object.__xdtor();
else static if(__traits(hasMember, T, "__dtor"))object.__dtor();
free(cast(void*)object);
}
static void alignDispose(T)(T object)
{
static if(__traits(hasMember, T, "__dtor"))object.__dtor();
static if(__traits(hasMember, T, "__xdtor"))object.__xdtor();
else static if(__traits(hasMember, T, "__dtor"))object.__dtor();
version(Posix)free(cast(void*)object);
else version(Windows)_aligned_free(cast(void*)object);
else version(ECSEmscripten)free(cast(void*)object);