#include "pch.hpp"

#include "eventid.hpp"

GosEventIdMgr::EventInfo *GosEventIdMgr::pEventInfo = NULL;
unsigned long		GosEventIdMgr::NextEntry = 0;
int					GosEventIdMgr::ListSize = 0;
int					GosEventIdMgr::ListSpace = 0;


void GosEventIdMgr::Resize()
{
	if( ListSize == 0 )
	{
		ListSize = 100;
		ListSpace = ListSize - 1;
		NextEntry = 1;
		pEventInfo = (EventInfo *)malloc( ListSize * sizeof(EventInfo) );
	}
	else
	{
		ListSpace = 100;
		ListSize += ListSpace;
		pEventInfo = (EventInfo *)realloc( pEventInfo, ListSize * sizeof(EventInfo) );
	}
}

void GosEventIdMgr::Cleanup()
{
	if( ListSize )
	{
		ListSize = 0;
		free( pEventInfo );
	}
}
