Function nvcvAllocatorConstructCustom

Function Documentation

NVCVStatus nvcvAllocatorConstructCustom(const NVCVResourceAllocator *customAllocators, int32_t numCustomAllocators, NVCVAllocatorHandle *handle)

Constructs a custom allocator instance in the given storage.

The constructed allocator is configured to use the default resource allocator functions specified here.

When not needed anymore, the allocator instance must be destroyed by nvcvAllocatorDecRef function.

Parameters:
  • customAllocators[in] Array of custom resource allocators.

    • There must be at most one custom allocator for each memory type.

    • Restrictions on the custom allocator members apply, see NVCVResourceAllocator.

  • numCustomAllocators[in] Number of custom allocators in the array.

  • halloc[out] Where new instance handle will be written to.

    • Must not be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.

  • NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the allocator.

  • NVCV_SUCCESS – Allocator created successfully.