getMaxUsedStack() - stack usage reseach mini progress

This commit is contained in:
rusefi 2019-02-12 19:05:06 -05:00
parent 0eb2470a61
commit c34ba20aa0
1 changed files with 2 additions and 0 deletions

View File

@ -44,11 +44,13 @@ int getMaxUsedStack(uint8_t *ptr, int size) {
/**
* maximum used stack size total stack buffer size minus position of first modified byte
*/
#if ! EFI_UNIT_TEST
int used = 0;
for (int i = 0; i < size; i++) {
if (ptr[i] != CH_DBG_STACK_FILL_VALUE) {
return size - i;
}
}
#endif /* EFI_UNIT_TEST */
return 0;
}