malloc

static C2S_NBCPool** g_NBCPools; static C2S_NBCAniUnit** g_NBCAniUnits; static void init() { g_NBCPools = (C2S_NBCPool**)malloc(count * sizeof(C2S_NBCPool*)); g_NBCAniUnits = (C2S_NBCAniUnit**)malloc(count * sizeof(C2S_NBCAniUnit*)); for (int i=0; i<GetSize_FeaturingList(); ++i) { g_NBCPools[i] = (C2S_NBCPool*)malloc(sizeof(C2S_NBCPool)); memset(g_NBCPools[i], 0, sizeof(C2S_NBCPool)); g_NBCAniUnits[i] = (C2S_NBCAniUnit*)malloc(sizeof(C2S_NBCAniUnit)); memset(g_NBCAniUnits[i], 0, sizeof(C2S_NBCAniUnit)); } } static void release() { for (int i=0; i<count; ++i) { Util_DestroyNBCPool(g_NBCPools[i]); SAFE_FREE(g_NBCPools[i]); SAFE_FREE(g_NBCAniUnits[i]); } SAFE_FREE(g_NBCPools); SAFE_FREE(g_NBCAniUnits); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.