MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / destroyBufferStruct

Function destroyBufferStruct

test_conformance/vectors/structs.cpp:157–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157bufferStruct *destroyBufferStruct(bufferStruct *destroyMe, clState *pClState)
158{
159 if (destroyMe)
160 {
161 if (destroyMe->m_outBuffer != NULL)
162 {
163#if DEBUG_MEM_ALLOC
164 log_info("clReleaseMemObject %x\n", destroyMe->m_outBuffer);
165#endif
166 clReleaseMemObject(destroyMe->m_outBuffer);
167 destroyMe->m_outBuffer = NULL;
168 }
169 if (destroyMe->m_inBuffer != NULL)
170 {
171#if DEBUG_MEM_ALLOC
172 log_info("clReleaseMemObject %x\n", destroyMe->m_outBuffer);
173#endif
174 clReleaseMemObject(destroyMe->m_inBuffer);
175 destroyMe->m_inBuffer = NULL;
176 }
177 if (destroyMe->m_pIn != NULL)
178 {
179#if DEBUG_MEM_ALLOC
180 log_info("delete (free) m_pIn %x\n", destroyMe->m_pIn);
181#endif
182 free(destroyMe->m_pIn);
183 destroyMe->m_pIn = NULL;
184 }
185 if (destroyMe->m_pOut != NULL)
186 {
187#if DEBUG_MEM_ALLOC
188 log_info("delete (free) m_pOut %x\n", destroyMe->m_pOut);
189#endif
190 free(destroyMe->m_pOut);
191 destroyMe->m_pOut = NULL;
192 }
193#if DEBUG_MEM_ALLOC
194 log_info("delete (free) bufferStruct * %x\n", destroyMe);
195#endif
196 free((void *)destroyMe);
197 destroyMe = NULL;
198 }
199 return destroyMe;
200}
201
202void initContents(bufferStruct *pBufferStruct, clState *pClState,
203 size_t typeSize, size_t countIn, size_t countOut)

Callers 3

test_vec_internalFunction · 0.85
test_step_internalFunction · 0.85
newBufferStructFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_vec_internalFunction · 0.68
test_step_internalFunction · 0.68