heap: Wrap the function hook feature under a configuration

also update heap_debug.rst and mem_alloc.rst to provide information about the feature
This commit is contained in:
Guillaume Souchere
2023-03-08 10:48:17 +01:00
committed by Mahavir Jain
parent 5a1f0cd63c
commit 2f982107dc
8 changed files with 42 additions and 0 deletions

View File

@@ -182,6 +182,7 @@ TEST_CASE("test get allocated size", "[heap]")
}
}
#ifdef CONFIG_HEAP_USE_HOOKS
// provide the definition of alloc and free hooks
static const size_t alloc_size = 1234; // make this size atypical to be able to rely on it in the hook
static const size_t expected_calls = 2; // one call for malloc/calloc and one call for realloc
@@ -247,3 +248,4 @@ TEST_CASE("test allocation and free function hooks", "[heap]")
TEST_ASSERT_TRUE(test_success);
}
#endif