Android update and small improvements
-fixed code do cross compiling to android -fixed build with GCC (workaround) -added little benchmark -several small fixes -updated meson build (demos building, working with GCC, LDC and DMD) -added some meson options -added ImGUI bind for OpenGL3
This commit is contained in:
parent
86edfa4a57
commit
66860b9042
30 changed files with 1358 additions and 173 deletions
|
|
@ -112,7 +112,7 @@ else version (D_BetterC)
|
|||
{
|
||||
private const uint max_alloca = 10000;
|
||||
private __gshared byte[max_alloca] alloca_array;
|
||||
private uint alloca_pos = 0;
|
||||
private __gshared uint alloca_pos = 0;
|
||||
export extern (C) void* __alloca(size_t length) @nogc nothrow
|
||||
{
|
||||
if (alloca_pos + length > max_alloca)
|
||||
|
|
@ -158,7 +158,32 @@ static struct Mallocator
|
|||
|
||||
static if (__traits(isPOD, T))
|
||||
{
|
||||
static immutable T init = T.init;
|
||||
__gshared immutable T init = T.init;
|
||||
|
||||
foreach (i; 0 .. ret.length)
|
||||
{
|
||||
memcpy(&ret[i], &init, T.sizeof);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static import std.conv;
|
||||
|
||||
foreach (i; 0 .. ret.length)
|
||||
{
|
||||
std.conv.emplace(&ret[i]);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static T[] alignMakeArray(T)(size_t length, size_t alignment) nothrow @nogc
|
||||
{
|
||||
T[] ret = (cast(T*) alignAlloc(T.sizeof * length, alignment))[0 .. length];
|
||||
|
||||
static if (__traits(isPOD, T))
|
||||
{
|
||||
__gshared immutable T init = T.init;
|
||||
|
||||
foreach (i; 0 .. ret.length)
|
||||
{
|
||||
|
|
@ -206,7 +231,7 @@ static struct Mallocator
|
|||
|
||||
static if (__traits(isPOD, T))
|
||||
{
|
||||
static immutable T init = T.init;
|
||||
__gshared immutable T init = T.init;
|
||||
memcpy(ret, &init, T.sizeof);
|
||||
}
|
||||
else static if (is(T == struct))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue