MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / Grow

Method Grow

UTCP/src/UT_Queue.cpp:100–125  ·  view source on GitHub ↗

Grow Grows the size of the queue if the queue can be grown. RETURN: true if successful, else false NOTE: this is terribly inefficient and should only be used when absolutely necessary. ************************************************/

Source from the content-addressed store, hash-verified

98 only be used when absolutely necessary.
99************************************************/
100bool CUT_FIFO_Queue::Grow() {
101
102 if(m_cbGrow == 0)
103 return false;
104
105 LPBYTE pbNew = new BYTE[m_cbBuffer + m_cbGrow];
106
107 if(pbNew == NULL)
108 return false;
109
110 int curSize = GetDataSize();
111
112 if(Peek(pbNew, curSize) != curSize) {
113 delete [] pbNew;
114
115 return false;
116 }
117
118 delete [] m_pbBuffer;
119 m_pbBuffer = pbNew;
120 m_cbBuffer += m_cbGrow;
121 m_iReadPointer = 0;
122 m_iWritePointer = curSize;
123
124 return true;
125}
126
127/***********************************************
128Read

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected