MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / util_allocEpsilonSensitiveHeapFlag

Function util_allocEpsilonSensitiveHeapFlag

quest/src/core/utilities.cpp:878–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878int* util_allocEpsilonSensitiveHeapFlag() {
879
880 int* ptr = cpu_allocHeapFlag(); // may be nullptr
881
882 // if failed to alloc, do not add to global list;
883 // caller will handle validation/error messaging
884 if (!mem_isAllocated(ptr))
885 return ptr;
886
887 // caller should set ptr to the default "unknown"
888 // value, but we do so here too just to be safe
889 util_setFlagToUnknown(ptr);
890
891 // store the pointer so that we can reset the
892 // value to "unknown" when epsilon is changed
893 globalStructFieldPtrs.push_back(ptr);
894 return ptr;
895}
896
897void util_deallocEpsilonSensitiveHeapFlag(int* ptr) {
898

Callers 5

createKrausMapFunction · 0.85
createCompMatrFunction · 0.85
createDiagMatrFunction · 0.85
createPauliStrSumFunction · 0.85

Calls 3

cpu_allocHeapFlagFunction · 0.85
mem_isAllocatedFunction · 0.85
util_setFlagToUnknownFunction · 0.85

Tested by

no test coverage detected