MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Alloc

Method Alloc

LuaSTGPlus/ObjectPool.hpp:20–31  ·  view source on GitHub ↗

@brief ����һ������ @param[out] id ����id @return �Ƿ�ɹ���ʧ�ܷ���false�������������

Source from the content-addressed store, hash-verified

18 /// @param[out] id ����id
19 /// @return �Ƿ�ɹ���ʧ�ܷ���false�������������
20 bool Alloc(size_t& id)
21 {
22 if (m_FreeIndex.size() > 0)
23 {
24 id = m_FreeIndex.back();
25 m_FreeIndex.pop_back();
26 m_DataUsed[id] = true;
27 return true;
28 }
29 id = static_cast<size_t>(-1);
30 return false;
31 }
32 /// @brief ����һ������
33 void Free(size_t id)
34 {

Callers 3

AllocInstanceMethod · 0.80
NewMethod · 0.80
ResourceMgr.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected