MCPcopy
hub / github.com/uber/aresdb / deviceFreeAndSetNil

Function deviceFreeAndSetNil

query/device_allocator.go:126–131  ·  view source on GitHub ↗

deviceFreeAndSetNil frees the specified device pointer if it's not null and set the pointer it holds to null.

(dp *devicePointer)

Source from the content-addressed store, hash-verified

124
125// deviceFreeAndSetNil frees the specified device pointer if it's not null and set the pointer it holds to null.
126func deviceFreeAndSetNil(dp *devicePointer) {
127 if dp != nil && !dp.isNull() && dp.allocated {
128 getDeviceAllocator().deviceFree(*dp)
129 *dp = nullDevicePointer
130 }
131}
132
133func reportAllocatedMemory(deviceCount int, da deviceAllocator) {
134 // getAllocatedMemory may panic, therefore we should recover here

Callers 10

shrinkStackFrameMethod · 0.85
cleanUpDeviceStatusMethod · 0.85
cleanUpForeignTableMethod · 0.85
processBatchMethod · 0.85

Calls 3

getDeviceAllocatorFunction · 0.85
isNullMethod · 0.80
deviceFreeMethod · 0.65

Tested by

no test coverage detected