Lines Matching refs:impl
20 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextHasValidData_Memcheck() local
22 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextHasValidData_Memcheck()
23 *has_valid_data = !!impl->data_allocated; in CeedQFunctionContextHasValidData_Memcheck()
31 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextHasBorrowedDataOfType_Memcheck() local
35 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextHasBorrowedDataOfType_Memcheck()
36 *has_borrowed_data_of_type = !!impl->data_borrowed; in CeedQFunctionContextHasBorrowedDataOfType_Memcheck()
45 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextSetData_Memcheck() local
49 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextSetData_Memcheck()
53 if (impl->data_allocated) { in CeedQFunctionContextSetData_Memcheck()
54 memset(impl->data_allocated, -42, ctx_size); in CeedQFunctionContextSetData_Memcheck()
55 VALGRIND_DISCARD(impl->allocated_block_id); in CeedQFunctionContextSetData_Memcheck()
57 CeedCallBackend(CeedFree(&impl->data_allocated)); in CeedQFunctionContextSetData_Memcheck()
58 if (impl->data_owned) { in CeedQFunctionContextSetData_Memcheck()
59 memset(impl->data_owned, -42, ctx_size); in CeedQFunctionContextSetData_Memcheck()
60 VALGRIND_DISCARD(impl->owned_block_id); in CeedQFunctionContextSetData_Memcheck()
62 CeedCallBackend(CeedFree(&impl->data_owned)); in CeedQFunctionContextSetData_Memcheck()
65 if (impl->data_borrowed) VALGRIND_DISCARD(impl->borrowed_block_id); in CeedQFunctionContextSetData_Memcheck()
70 impl->data_owned = NULL; in CeedQFunctionContextSetData_Memcheck()
71 impl->data_borrowed = NULL; in CeedQFunctionContextSetData_Memcheck()
74 impl->data_owned = data; in CeedQFunctionContextSetData_Memcheck()
75 impl->data_borrowed = NULL; in CeedQFunctionContextSetData_Memcheck()
76 …impl->owned_block_id = VALGRIND_CREATE_BLOCK(impl->data_owned, ctx_size, "Owned external data buff… in CeedQFunctionContextSetData_Memcheck()
79 impl->data_owned = NULL; in CeedQFunctionContextSetData_Memcheck()
80 impl->data_borrowed = data; in CeedQFunctionContextSetData_Memcheck()
81 …impl->owned_block_id = VALGRIND_CREATE_BLOCK(impl->data_borrowed, ctx_size, "Borrowed external dat… in CeedQFunctionContextSetData_Memcheck()
85 CeedCallBackend(CeedMallocArray(1, ctx_size, &impl->data_allocated)); in CeedQFunctionContextSetData_Memcheck()
86 …impl->allocated_block_id = VALGRIND_CREATE_BLOCK(impl->data_allocated, ctx_size, "'Allocated inter… in CeedQFunctionContextSetData_Memcheck()
87 memcpy(impl->data_allocated, data, ctx_size); in CeedQFunctionContextSetData_Memcheck()
96 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextSyncData_Memcheck() local
100 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextSyncData_Memcheck()
104 if (impl->data_owned) { in CeedQFunctionContextSyncData_Memcheck()
105 memcpy(impl->data_owned, impl->data_allocated, ctx_size); in CeedQFunctionContextSyncData_Memcheck()
107 if (impl->data_borrowed) { in CeedQFunctionContextSyncData_Memcheck()
108 memcpy(impl->data_borrowed, impl->data_allocated, ctx_size); in CeedQFunctionContextSyncData_Memcheck()
118 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextTakeData_Memcheck() local
122 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextTakeData_Memcheck()
129 *(void **)data = impl->data_borrowed; in CeedQFunctionContextTakeData_Memcheck()
130 impl->data_borrowed = NULL; in CeedQFunctionContextTakeData_Memcheck()
131 VALGRIND_DISCARD(impl->borrowed_block_id); in CeedQFunctionContextTakeData_Memcheck()
134 if (impl->data_allocated) { in CeedQFunctionContextTakeData_Memcheck()
135 memset(impl->data_allocated, -42, ctx_size); in CeedQFunctionContextTakeData_Memcheck()
136 VALGRIND_DISCARD(impl->allocated_block_id); in CeedQFunctionContextTakeData_Memcheck()
138 CeedCallBackend(CeedFree(&impl->data_allocated)); in CeedQFunctionContextTakeData_Memcheck()
147 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextGetData_Memcheck() local
151 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextGetData_Memcheck()
155 CeedCallBackend(CeedMallocArray(1, ctx_size, &impl->data_writable_copy)); in CeedQFunctionContextGetData_Memcheck()
156 …impl->writable_block_id = VALGRIND_CREATE_BLOCK(impl->data_writable_copy, ctx_size, "Allocated wri… in CeedQFunctionContextGetData_Memcheck()
157 memcpy(impl->data_writable_copy, impl->data_allocated, ctx_size); in CeedQFunctionContextGetData_Memcheck()
158 *(void **)data = impl->data_writable_copy; in CeedQFunctionContextGetData_Memcheck()
167 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextGetDataRead_Memcheck() local
171 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextGetDataRead_Memcheck()
175 if (!impl->data_read_only_copy) { in CeedQFunctionContextGetDataRead_Memcheck()
176 CeedCallBackend(CeedMallocArray(1, ctx_size, &impl->data_read_only_copy)); in CeedQFunctionContextGetDataRead_Memcheck()
177 …impl->writable_block_id = VALGRIND_CREATE_BLOCK(impl->data_read_only_copy, ctx_size, "Allocated re… in CeedQFunctionContextGetDataRead_Memcheck()
178 memcpy(impl->data_read_only_copy, impl->data_allocated, ctx_size); in CeedQFunctionContextGetDataRead_Memcheck()
180 *(void **)data = impl->data_read_only_copy; in CeedQFunctionContextGetDataRead_Memcheck()
189 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextRestoreData_Memcheck() local
192 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextRestoreData_Memcheck()
195 memcpy(impl->data_allocated, impl->data_writable_copy, ctx_size); in CeedQFunctionContextRestoreData_Memcheck()
199 memset(impl->data_writable_copy, -42, ctx_size); in CeedQFunctionContextRestoreData_Memcheck()
200 CeedCallBackend(CeedFree(&impl->data_writable_copy)); in CeedQFunctionContextRestoreData_Memcheck()
201 VALGRIND_DISCARD(impl->writable_block_id); in CeedQFunctionContextRestoreData_Memcheck()
210 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextRestoreDataRead_Memcheck() local
213 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextRestoreDataRead_Memcheck()
216 bool is_changed = memcmp(impl->data_allocated, impl->data_read_only_copy, ctx_size); in CeedQFunctionContextRestoreDataRead_Memcheck()
221 memset(impl->data_read_only_copy, -42, ctx_size); in CeedQFunctionContextRestoreDataRead_Memcheck()
222 CeedCallBackend(CeedFree(&impl->data_read_only_copy)); in CeedQFunctionContextRestoreDataRead_Memcheck()
223 VALGRIND_DISCARD(impl->read_only_block_id); in CeedQFunctionContextRestoreDataRead_Memcheck()
233 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextDataDestroy_Memcheck() local
235 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextDataDestroy_Memcheck()
243 bool is_borrowed = !!impl->data_borrowed; in CeedQFunctionContextDataDestroy_Memcheck()
245 CeedCallBackend(data_destroy_function(is_borrowed ? impl->data_borrowed : impl->data_owned)); in CeedQFunctionContextDataDestroy_Memcheck()
246 if (is_borrowed) VALGRIND_DISCARD(impl->borrowed_block_id); in CeedQFunctionContextDataDestroy_Memcheck()
247 else VALGRIND_DISCARD(impl->owned_block_id); in CeedQFunctionContextDataDestroy_Memcheck()
250 if (impl->data_allocated) { in CeedQFunctionContextDataDestroy_Memcheck()
251 CeedCallBackend(CeedFree(&impl->data_allocated)); in CeedQFunctionContextDataDestroy_Memcheck()
252 VALGRIND_DISCARD(impl->allocated_block_id); in CeedQFunctionContextDataDestroy_Memcheck()
254 if (impl->data_owned) { in CeedQFunctionContextDataDestroy_Memcheck()
255 CeedCallBackend(CeedFree(&impl->data_owned)); in CeedQFunctionContextDataDestroy_Memcheck()
256 VALGRIND_DISCARD(impl->owned_block_id); in CeedQFunctionContextDataDestroy_Memcheck()
258 if (impl->data_borrowed) { in CeedQFunctionContextDataDestroy_Memcheck()
259 VALGRIND_DISCARD(impl->borrowed_block_id); in CeedQFunctionContextDataDestroy_Memcheck()
268 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextDestroy_Memcheck() local
271 CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, &impl)); in CeedQFunctionContextDestroy_Memcheck()
272 if (impl->data_allocated) { in CeedQFunctionContextDestroy_Memcheck()
273 CeedCallBackend(CeedFree(&impl->data_allocated)); in CeedQFunctionContextDestroy_Memcheck()
274 VALGRIND_DISCARD(impl->allocated_block_id); in CeedQFunctionContextDestroy_Memcheck()
276 if (impl->data_owned) { in CeedQFunctionContextDestroy_Memcheck()
277 CeedCallBackend(CeedFree(&impl->data_owned)); in CeedQFunctionContextDestroy_Memcheck()
278 VALGRIND_DISCARD(impl->owned_block_id); in CeedQFunctionContextDestroy_Memcheck()
280 if (impl->data_borrowed) { in CeedQFunctionContextDestroy_Memcheck()
281 VALGRIND_DISCARD(impl->borrowed_block_id); in CeedQFunctionContextDestroy_Memcheck()
283 CeedCallBackend(CeedFree(&impl)); in CeedQFunctionContextDestroy_Memcheck()
292 CeedQFunctionContext_Memcheck *impl; in CeedQFunctionContextCreate_Memcheck() local
306 CeedCallBackend(CeedCalloc(1, &impl)); in CeedQFunctionContextCreate_Memcheck()
307 CeedCallBackend(CeedQFunctionContextSetBackendData(ctx, impl)); in CeedQFunctionContextCreate_Memcheck()