-almost every funtion is marked as @nogc and nothrow (only problem with HashMap)

This commit is contained in:
Mergul 2018-11-02 16:36:38 +01:00
parent fef55bd790
commit 204ce9dc79
10 changed files with 74 additions and 72 deletions

View file

@ -12,7 +12,7 @@ struct BlockAllocator//(uint block_size, uint blocks_in_allocation)
void* next_block = null;
void* getBlock()
void* getBlock() nothrow @nogc
{
if (next_block is null)
allocBlock();
@ -21,13 +21,13 @@ struct BlockAllocator//(uint block_size, uint blocks_in_allocation)
return ret;
}
void freeBlock(void* block)
void freeBlock(void* block) nothrow @nogc
{
*cast(void**)block = next_block;
next_block = block;
}
private void allocBlock()
private void allocBlock() nothrow @nogc
{
next_block = cast(void*) AlignedMallocator.instance.alignedAllocate(
block_size * blocks_in_allocation, block_size);