mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-02-05 11:13:51 +00:00
Updated metadata
This commit is contained in:
@@ -1796,6 +1796,7 @@ void ILibChain_SafeRemoveEx(void *chain, void *object)
|
||||
if (link != NULL)
|
||||
{
|
||||
if (link->DestroyHandler != NULL) { link->DestroyHandler(link); }
|
||||
ILibMemory_Free(link->MetaData);
|
||||
ILibChain_FreeLink(link);
|
||||
ILibLinkedList_Remove(node);
|
||||
}
|
||||
@@ -1910,7 +1911,12 @@ void* ILibGetBaseTimer(void *chain)
|
||||
//return ILibCreateLifeTime(chain);
|
||||
return (chain == NULL ? NULL : ((struct ILibBaseChain*)chain)->Timer);
|
||||
}
|
||||
|
||||
ILibChain_Link* ILibChain_GetCurrentLink(void *chain)
|
||||
{
|
||||
if (chain == NULL) { return(NULL); }
|
||||
if (((ILibBaseChain*)chain)->node == NULL) { return(NULL); }
|
||||
return((ILibChain_Link*)ILibLinkedList_GetDataFromNode(((ILibBaseChain*)chain)->node));
|
||||
}
|
||||
#ifdef WIN32
|
||||
void __stdcall ILibForceUnBlockChain_APC(ULONG_PTR obj)
|
||||
{
|
||||
@@ -1959,6 +1965,7 @@ void ILibChain_DestroyEx(void *subChain)
|
||||
while (node != NULL && (module = (ILibChain_Link*)ILibLinkedList_GetDataFromNode(node)) != NULL)
|
||||
{
|
||||
if (module->DestroyHandler != NULL) { module->DestroyHandler((void*)module); }
|
||||
ILibMemory_Free(module->MetaData);
|
||||
ILibChain_FreeLink(module);
|
||||
node = ILibLinkedList_GetNextNode(node);
|
||||
}
|
||||
@@ -2303,6 +2310,7 @@ ILibExportMethod void ILibChain_Continue(void *Chain, ILibChain_Link **modules,
|
||||
if (module != NULL)
|
||||
{
|
||||
if (module->DestroyHandler != NULL) { module->DestroyHandler((void*)module); }
|
||||
ILibMemory_Free(module->MetaData);
|
||||
ILibChain_FreeLink(module);
|
||||
}
|
||||
}
|
||||
@@ -3563,6 +3571,7 @@ ILibExportMethod void ILibStartChain(void *Chain)
|
||||
if (module != NULL)
|
||||
{
|
||||
if (module->DestroyHandler != NULL) { module->DestroyHandler((void*)module); }
|
||||
ILibMemory_Free(module->MetaData);
|
||||
ILibChain_FreeLink(module);
|
||||
}
|
||||
}
|
||||
@@ -3703,6 +3712,7 @@ ILibExportMethod void ILibStartChain(void *Chain)
|
||||
// If this module has a destroy method, call it.
|
||||
//
|
||||
if (module->DestroyHandler != NULL) module->DestroyHandler((void*)module);
|
||||
ILibMemory_Free(module->MetaData);
|
||||
//
|
||||
// After calling the Destroy, we free the module and move to the next
|
||||
//
|
||||
@@ -3730,6 +3740,7 @@ ILibExportMethod void ILibStartChain(void *Chain)
|
||||
if (chain->node!=NULL && (module=(ILibChain_Link*)ILibLinkedList_GetDataFromNode(chain->node))!=NULL)
|
||||
{
|
||||
module->DestroyHandler((void*)module);
|
||||
ILibMemory_Free(module->MetaData);
|
||||
ILibChain_FreeLink(module);
|
||||
((ILibBaseChain*)Chain)->Timer = NULL;
|
||||
}
|
||||
@@ -3740,6 +3751,7 @@ ILibExportMethod void ILibStartChain(void *Chain)
|
||||
while(chain->node != NULL && (module = (ILibChain_Link*)ILibLinkedList_GetDataFromNode(chain->node)) != NULL)
|
||||
{
|
||||
if(module->DestroyHandler != NULL) {module->DestroyHandler((void*)module);}
|
||||
ILibMemory_Free(module->MetaData);
|
||||
ILibChain_FreeLink(module);
|
||||
chain->node = ILibLinkedList_GetNextNode(chain->node);
|
||||
}
|
||||
|
||||
@@ -388,6 +388,8 @@ int ILibIsRunningOnChainThread(void* chain);
|
||||
ILibMemory_Types memoryType;
|
||||
}ILibMemory_Header;
|
||||
|
||||
#define ILibChain_Link_SetMetadata(chainLink, value) if((chainLink)!=NULL) { ILibMemory_Free(((ILibChain_Link*)chainLink)->MetaData); ((ILibChain_Link*)chainLink)->MetaData = value; }
|
||||
#define ILibChain_Link_GetMetadata(chainLink) ((chainLink)==NULL?"":(((ILibChain_Link*)chainLink)->MetaData))
|
||||
#define ILibMemory_Canary (((int*)((char*)(const char*)"broe"))[0])
|
||||
#define ILibMemory_RawPtr(ptr) ((char*)(ptr) - sizeof(ILibMemory_Header))
|
||||
#define ILibMemory_RawSize(ptr) (ILibMemory_Size((ptr)) + ILibMemory_ExtraSize((ptr)) + sizeof(ILibMemory_Header))
|
||||
@@ -971,6 +973,7 @@ int ILibIsRunningOnChainThread(void* chain);
|
||||
void ILibChain_SafeRemoveEx(void *chain, void *object);
|
||||
void ILibChain_DestroyEx(void *chain);
|
||||
void ILibChain_DisableWatchDog(void *chain);
|
||||
ILibChain_Link* ILibChain_GetCurrentLink(void *chain);
|
||||
void *ILibChain_GetObjectForDescriptor(void *chain, int fd);
|
||||
char *ILibChain_GetMetaDataFromDescriptorSet(void *chain, fd_set *inr, fd_set *inw, fd_set *ine);
|
||||
char *ILibChain_GetMetaDataFromDescriptorSetEx(void *chain, fd_set *inr, fd_set *inw, fd_set *ine);
|
||||
|
||||
@@ -6377,9 +6377,11 @@ void* ILibStunClient_Start(void *Chain, unsigned short LocalPort, ILibStunClient
|
||||
obj->ChainLink.DestroyHandler = &ILibStun_OnDestroy;
|
||||
obj->UDP = ILibAsyncUDPSocket_CreateEx(Chain, ILibRUDP_MaxMTU, (struct sockaddr*)&(obj->LocalIf), ILibAsyncUDPSocket_Reuse_EXCLUSIVE, &ILibStun_OnUDP, NULL, obj);
|
||||
if (obj->UDP == NULL) { free(obj); return NULL; }
|
||||
ILibChain_Link_SetMetadata(obj->UDP, "ILibWebRTC_stun_listener_ipv4");
|
||||
#ifdef WIN32
|
||||
obj->UDP6 = ILibAsyncUDPSocket_CreateEx(Chain, ILibRUDP_MaxMTU, (struct sockaddr*)&(obj->LocalIf6), ILibAsyncUDPSocket_Reuse_EXCLUSIVE, &ILibStun_OnUDP, NULL, obj);
|
||||
if (obj->UDP6 == NULL) { free(obj); return NULL; }
|
||||
ILibChain_Link_SetMetadata(obj->UDP6, "ILibWebRTC_stun_listener_ipv6");
|
||||
#endif
|
||||
|
||||
ILibAddToChain(Chain, obj);
|
||||
|
||||
Reference in New Issue
Block a user