MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zDispatcher_memPool

Function zDispatcher_memPool

src/SB/Game/zDispatcher.cpp:63–79  ·  view source on GitHub ↗

Compiler is optimizng the size calcuation and moving parameters for memset differently.

Source from the content-addressed store, hash-verified

61 if (g_zdsp_init == 0)
62 {
63 memset(depot, 0, sizeof(st_ZDISPATCH_DEPOT));
64 }
65}
66
67st_ZDISPATCH_DATA* zDispatcher_memPool(S32 cnt)
68{
69 st_ZDISPATCH_DATA* pool;
70 st_ZDISPATCH_DEPOT* depot = &g_zdsp_depot;
71 if (cnt < 1)
72 {
73 return NULL;
74 }
75 else
76 {
77 pool = (st_ZDISPATCH_DATA*)xMemAlloc(gActiveHeap, cnt * sizeof(st_ZDISPATCH_DATA), 0);
78 memset(pool, 0, cnt * sizeof(st_ZDISPATCH_DATA));
79 depot->raw_pool = pool;
80 depot->raw_cnt = cnt;
81 return pool;
82 }

Callers 1

Calls 2

memsetFunction · 0.85
xMemAllocFunction · 0.50

Tested by

no test coverage detected