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:
parent
7a227ee7a4
commit
f0ff0d3630
2 changed files with 62 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue