Function nvcvAllocatorDecRef

Function Documentation

NVCVStatus nvcvAllocatorDecRef(NVCVAllocatorHandle handle, int *newRefCount)

Decrements the reference count of an existing allocator instance.

The allocator is destroyed when its reference count reaches zero.

Note

All objects that depend on the allocator instance must already be destroyed, if not undefined behavior will ensue, possibly segfaults.

Parameters:
  • handle[in] Allocator to be destroyed. If NULL, no operation is performed, successfully.

    • The handle must have been created with any of the nvcvAllocatorConstruct functions.

  • newRefCount[out] The decremented reference count. If the return value is 0, the object was destroyed. Can be NULL, if the caller isn’t interested in the new reference count.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – The handle is invalid

  • NVCV_SUCCESS – Operation executed successfully.