1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 11:38:02 +02:00

Improved null handling in reflected method invocation

This commit is contained in:
Brian Fiete 2022-03-01 10:37:13 -08:00
parent 7a227ee7a4
commit f0ff0d3630
2 changed files with 62 additions and 5 deletions

View file

@ -273,4 +273,19 @@ static
}
data
}
public static mixin ScopedAllocZero(int size, int align)
{
void* data;
if (size <= 128)
{
data = scope:mixin [Align(align)] uint8[size]*;
}
else
{
data = new [Align(align)] uint8[size]*;
defer:mixin delete data;
}
data
}
}