1
0
forked from fsfw/fsfw

add fill count func added

This commit is contained in:
2020-10-14 23:41:16 +02:00
parent 7bd536e763
commit 57c9775d7d
3 changed files with 66 additions and 23 deletions

View File

@ -286,3 +286,16 @@ ReturnValue_t LocalPool::findEmpty(uint16_t poolIndex, uint16_t *element) {
}
return status;
}
size_t LocalPool::getTotalSize(size_t* additionalSize) {
size_t totalSize = 0;
size_t sizesSize = 0;
for(uint8_t idx = 0; idx < NUMBER_OF_POOLS; idx ++) {
totalSize += elementSizes[idx] * numberOfElements[idx];
sizesSize += numberOfElements[idx] * sizeof(size_type);
}
if(additionalSize != nullptr) {
*additionalSize = sizesSize;
}
return totalSize;
}