- Add LibNode 3 API support:

- Update ND_DataStruct_Open() calls,
    - Use SMG_DataStruct_Handlers.
This commit is contained in:
Arnaud G. GIBERT 2024-05-25 13:03:36 +02:00
parent b3f6b67d9c
commit 842da177f5
3 changed files with 52 additions and 12 deletions

View File

@ -4,6 +4,8 @@ LibShMem V 3.0.0 - A. GIBERT - 2024/05/xx
- All:
- Working on new API...
- LibShMem:
- Add LibNode 3 API support.
@ -11,10 +13,12 @@ LibShMem V 3.0.0 - A. GIBERT - 2024/05/xx
LibShMem V 2.1.0 - A. GIBERT - 2024/05/21
------------------------------------------------------------------------------------------------------------------------------------
All: - This new LibShMem branch (2.1.x) support the new LibNode branch (2.3.x) & LibLog (1.0.x),
All:
- This new LibShMem branch (2.1.x) support the new LibNode branch (2.3.x) & LibLog (1.0.x),
- Switch to LGPL/GPL V3 & FGD V1.3 licenses,
- Last 2.x release branch, now working on LibShMem 3!
LibShMem: - Major code cleanup,
LibShMem:
- Major code cleanup,
- Start French to English translation.

View File

@ -118,7 +118,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O
/* Ouverture de la liste des heaps ouverts (locale) */
rc = ND_DataStruct_Open( &Opened_Heap_List, 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, NULL, NULL, NULL, TRUE, NULL);
rc = ND_DataStruct_Open( &Opened_Heap_List, "SM Opened Heap", 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, TRUE, NULL);
if( rc != NDS_OK)
{
LG_LOG_ERROR_0( "SM_Library_Open : unable to create the local opened heap cache");
@ -167,7 +167,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O
/* Ouverture de la liste des heaps ouverts (locale) */
rc = ND_DataStruct_Open( &Opened_Heap_List, 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, NULL, NULL, NULL, TRUE, NULL);
rc = ND_DataStruct_Open( &Opened_Heap_List, "SM Opened Heap", 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, TRUE, NULL);
if( rc != NDS_OK)
{
LG_LOG_ERROR_0( "Unable to create the local opened heap cache");
@ -2527,10 +2527,12 @@ SMT_Status SM_Base_Init ( void )
SM_Base->Attach = SM_Base->Free;
/* Création du MHR dans la base */
rc = ND_DataStruct_Open( &( SM_Base->MHR), 1, &index_type, "MHR_Manager", NULL, "SM_Base_Alloc", NULL, "SM_Base_Free", NULL, TRUE, NULL);
if( rc != NDS_OK)
// rc = ND_DataStruct_Open( &( SM_Base->MHR), 1, &index_type, "MHR_Manager", NULL, "SM_Base_Alloc", NULL, "SM_Base_Free", NULL, TRUE, NULL);
if( ( rc = ND_DataStruct_Open( &( SM_Base->MHR), "SHM-MHR", 1, &index_type, "MHR_Manager", NULL, &SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK)
{
LG_LOG_ERROR_0( "Unable to create the MHR structure");
@ -3452,8 +3454,9 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node
- dans le heap système pour les autres heaps
*/
rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->DSR), 1, &index_type, "SM_DSR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( rc != NDS_OK)
// rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->DSR), 1, &index_type, "SM_DSR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->DSR), "SHM-DSR", 1, &index_type, "SM_DSR_Manager", NULL, &SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK)
{
LG_LOG_ERROR_0( "Unable to create the DSR structure");
goto Error4;
@ -3466,8 +3469,9 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node
- dans le heap système pour les autres heaps
*/
rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->ACR), 1, &index_type, "SM_ACR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( rc != NDS_OK)
// rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->ACR), 1, &index_type, "SM_ACR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->ACR), "SHM-ACR", 1, &index_type, "SM_ACR_Manager", NULL, &SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK)
{
LG_LOG_ERROR_0( "Unable to create the ACR structure");
goto Error5;
@ -3481,8 +3485,9 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node
- dans le heap système pour les autres heaps
*/
rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->FCR), 1, &index_type, "SM_FCR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( rc != NDS_OK)
// rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->FCR), 1, &index_type, "SM_FCR_Manager", NULL, SM_Base->MHR->Allocator_Name, NULL, SM_Base->MHR->Deallocator_Name, NULL, TRUE, NULL);
if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->FCR), "SHM-FCR", 1, &index_type, "SM_FCR_Manager", NULL, &SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK)
{
LG_LOG_ERROR_0( "Unable to create the FCR structure");
goto Error6;

View File

@ -172,6 +172,37 @@ typedef union semun
unsigned short int * array;
} semun;
/*------------------------------------------------------------------------------*/
/* */
/*------------------------------------------------------------------------------*/
NDT_DataStruct_Handlers SMG_DataStruct_Handlers =
{
"", /* Manager function name */
NULL, /* Manager function pointer */
"", /* Init function name */
NULL, /* Init function pointer */
"SM_Base_Alloc", /* Alloc function name */
NULL, /* Alloc function pointer */
"SM_Base_Free", /* Free function name */
NULL, /* Free function pointer */
"", /* Open function name */
NULL, /* Open function pointer */
"", /* Close function name */
NULL, /* Close function pointer */
"", /* Lock function name */
NULL, /* Lock function pointer */
"", /* Unlock function name */
NULL /* Unlock function pointer */
};
/*------------------------------------------------------------------------------*/
/* */
/*------------------------------------------------------------------------------*/