DVPPMallocFuncHookReg

Function Usage

Registers the API for customized memory management (DVPP memory allocation). This API and DVPPFreeFuncHookReg must be used in pairs. If they are not used in pairs or only one of them is registered, the default mode is used, that is, the memory is directly allocated or released. Only Atlas inference product support this API.

For details, see Customized Memory Resource Pool Management.

Prototype

1
APP_ERROR DVPPMallocFuncHookReg(g_dvppMallocFuncType pFun);

Parameters

Parameter

Input/Output

Description

pFun

Input

Function type for DVPP memory allocation. The input function must be of the same type as the following function:

1
APP_ERROR (*)(unsigned int, void**, unsigned long long);

The input parameters are as follows:

  • dev_id: Set this parameter based on the actual situation of the memory resource pool.
  • dev_ptr: Pointer to the pointer to the allocated DVPP memory.
  • Size: Requested memory size in bytes.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.