- Add ND_DataStruct_Alloc() & ND_DataStruct_Free() to help memory allocation inside a manager.

This commit is contained in:
2024-05-03 17:00:00 +02:00
parent c52ced19c5
commit afbf19b5a3
2 changed files with 103 additions and 0 deletions

View File

@@ -2202,6 +2202,78 @@ NDT_Status ND_DataStruct_Info_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Rec
/*----------------------------------------------------------------------------*/
/* Alloc memory unsing data structure allocator - Manager function */
/*----------------------------------------------------------------------------*/
/* (O) Memory_Ptr_Ptr: Memory pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Size: Allocation size */
/* (I) Data_Ptr: User pointer */
/*----------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Alloc_I( void **Ptr_Ptr, NDT_Root *Root_Ptr, size_t Size, void *Data_Ptr)
{
return( ND_Allocator_Exec_I( Ptr_Ptr, Root_Ptr, Size, Root_Ptr->Allocator_Name, Root_Ptr->Allocator_Ptr, Data_Ptr));
}
/*----------------------------------------------------------------------------*/
/* Alloc memory unsing data structure allocator - Manager function */
/*----------------------------------------------------------------------------*/
/* (O) Memory_Ptr_Ptr: Memory pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Size: Allocation size */
/* (I) Data_Ptr: User pointer */
/*----------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Alloc_C( void **Ptr_Ptr, NDT_Root *Root_Ptr, size_t Size, void *Data_Ptr)
{
return( ND_Allocator_Exec_I( Ptr_Ptr, Root_Ptr, Size, Root_Ptr->Allocator_Name, Root_Ptr->Allocator_Ptr, Data_Ptr));
}
/*----------------------------------------------------------------------------*/
/* Free memory unsing data structure allocator - Manager function */
/*----------------------------------------------------------------------------*/
/* (I) Memory_Ptr: Memory pointer */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Data_Ptr: User pointer */
/*----------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Free_I( void *Ptr, NDT_Root *Root_Ptr, void *Data_Ptr)
{
return( ND_Deallocator_Exec_I( Ptr, Root_Ptr, Root_Ptr->Deallocator_Name, Root_Ptr->Deallocator_Ptr, Data_Ptr));
}
/*----------------------------------------------------------------------------*/
/* Free memory unsing data structure allocator - Manager function */
/*----------------------------------------------------------------------------*/
/* (I) Memory_Ptr: Memory pointer */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Allocator_Name: Value deallocator function name */
/* (I) Allocator_Ptr: Value deallocator function pointer */
/* (I) Data_Ptr: User pointer */
/*----------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Free_C( void *Ptr, NDT_Root *Root_Ptr, void *Data_Ptr)
{
return( ND_Deallocator_Exec_I( Ptr, Root_Ptr, Root_Ptr->Deallocator_Name, Root_Ptr->Deallocator_Ptr, Data_Ptr));
}
/*----------------------------------------------------------------------------*/
/* Add a new value to a data structure index */
/*----------------------------------------------------------------------------*/