MCPcopy Create free account
hub / github.com/aardappel/lobster / Push

Method Push

dev/include/Box2D/Particle/b2StackQueue.h:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 void Push(const T &item)
44 {
45 if (m_back >= m_capacity)
46 {
47 for (int32 i = m_front; i < m_back; i++)
48 {
49 m_buffer[i - m_front] = m_buffer[i];
50 }
51 m_back -= m_front;
52 m_front = 0;
53 if (m_back >= m_capacity)
54 {
55 if (m_capacity > 0)
56 {
57 m_capacity *= 2;
58 }
59 else
60 {
61 m_capacity = 1;
62 }
63 m_buffer = (T*) m_allocator->Reallocate(m_buffer,
64 sizeof(T) * m_capacity);
65 }
66 }
67 m_buffer[m_back] = item;
68 m_back++;
69 }
70
71 void Pop()
72 {

Callers 1

GenerateMethod · 0.45

Calls 1

ReallocateMethod · 0.80

Tested by

no test coverage detected