MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / Initialize

Method Initialize

rEFIt_UEFI/cpp_foundation/XBuffer.h:172–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170//*************************************************************************************************
171template <typename T>
172void XBuffer<T>::Initialize(const T* p, size_t count, size_t index)
173{
174 if ( p!=NULL && count>0 )
175 {
176 m_allocatedSize = count;
177 _WData = (unsigned char*)malloc(m_allocatedSize);
178 if ( !_WData ) {
179 panic("XBuffer<T>::Initialize(%zu) : malloc returned NULL. System halted\n", count);
180 }
181 memcpy(_WData, p, count);
182 XRBuffer<T>::_RData = _WData;
183 XRBuffer<T>::m_size = count;
184 XRBuffer<T>::_Index = index;
185 }
186 else{
187 m_allocatedSize = 0;
188 _WData = NULL;
189 XRBuffer<T>::_RData = NULL;
190 XRBuffer<T>::m_size = 0;
191 XRBuffer<T>::_Index = 0;
192 }
193}
194
195//-------------------------------------------------------------------------------------------------
196// CheckSize

Callers 15

mainFunction · 0.80
mainFunction · 0.80
TargetTool.pyFile · 0.80
MainFunction · 0.80
Database.pyFile · 0.80
EccMain.pyFile · 0.80
MainFunction · 0.80
DecParserTest.pyFile · 0.80

Calls 3

mallocFunction · 0.50
panicFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected