-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

@ -70,13 +70,13 @@ struct EventManager
block.index = cast(ushort)(aligned_index + Ev.sizeof);
}*/
void initialize(EntityManager m)
void initialize(EntityManager m) nothrow @nogc
{
allocator = BlockAllocator(events_block_size, events_blocks_in_allocation);
manager = m;
}
void sendEvent(Ev)(EntityID id, Ev event, uint thread_id = 0)
void sendEvent(Ev)(EntityID id, Ev event, uint thread_id = 0) nothrow @nogc
{
uint block_id = current_index+thread_id;
@ -110,7 +110,7 @@ struct EventManager
block.count++;
}
void swapCurrent()
void swapCurrent() nothrow @nogc
{
uint threads_count = cast(uint)manager.threads.length;
if(current_index == 0)current_index = threads_count;
@ -136,7 +136,7 @@ struct EventManager
}
}
void clearEvents()
void clearEvents() nothrow @nogc
{
uint threads_count = cast(uint)manager.threads.length;
foreach(ref event;events)
@ -173,7 +173,7 @@ struct EventManager
process_events.current_block = null;*/
}
void allocateData(uint threads_count)
void allocateData(uint threads_count) nothrow @nogc
{
if(events)
{