Migrate built-in classes and interfaces to native C
Build / AerScript (push) Successful in 16s

This commit is contained in:
2026-11-19 16:15:05 +01:00
parent 58f604aea5
commit bcfa4c6163
8 changed files with 574 additions and 174 deletions
+4 -6
View File
@@ -22,18 +22,16 @@ PH7_PRIVATE sxi32 SySetPut(SySet *pSet, const void *pItem) {
unsigned char *zbase;
if(pSet->nUsed >= pSet->nSize) {
void *pNew;
sxu32 nSize = pSet->nSize > 0 ? pSet->nSize * 2 : 8;
if(pSet->pAllocator == 0) {
return SXERR_LOCKED;
}
if(pSet->nSize <= 0) {
pSet->nSize = 4;
}
pNew = SyMemBackendRealloc(pSet->pAllocator, pSet->pBase, pSet->eSize * pSet->nSize * 2);
pNew = SyMemBackendRealloc(pSet->pAllocator, pSet->pBase, pSet->eSize * nSize);
if(pNew == 0) {
return SXERR_MEM;
}
pSet->pBase = pNew;
pSet->nSize <<= 1;
pSet->nSize = nSize;
}
zbase = (unsigned char *)pSet->pBase;
SX_MACRO_FAST_MEMCPY(pItem, &zbase[pSet->nUsed * pSet->eSize], pSet->eSize);
@@ -384,4 +382,4 @@ PH7_PRIVATE SyHashEntry *SyHashLastEntry(SyHash *pHash) {
}
/* Last inserted entry */
return (SyHashEntry *)pHash->pList;
}
}