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

Function create_ptanks

src/SB/Core/x/xPtankPool.cpp:260–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258namespace
259{
260 U32 create_ptanks(group_data& group, u32 count)
261 {
262 U32 initial_size = group.size;
263 if (initial_size + count > group.max_size)
264 {
265 count = group.max_size - initial_size;
266 }
267
268 ptank_context* end = group.ptanks + initial_size + count;
269 ptank_context* it = group.ptanks + initial_size;
270 while (it < end)
271 {
272 RpAtomic* ptank = create_ptank(group.create_flags);
273 it->ptank = ptank;
274
275 if (it->ptank == NULL)
276 {
277 break;
278 }
279
280 it->flags = rpPTANKDFLAGPOSITION;
281 it->next = *group.buckets;
282 *group.buckets = it;
283 it++;
284 group.size++;
285 }
286
287 return group.size - initial_size;
288 }
289
290} // namespace
291

Callers 2

xPTankPoolSceneEnterFunction · 0.85
grab_blockMethod · 0.85

Calls 1

create_ptankFunction · 0.70

Tested by

no test coverage detected