-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/add_rom_tlsf_function_prototype' into 'master'
esp_rom: add rom tlsf function prototype instead of void * See merge request espressif/esp-idf!20670
- Loading branch information
Showing
4 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#pragma once | ||
#include <stddef.h> | ||
#include <stdbool.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/*! | ||
* Defines the function prototypes for multi_heap_internal_poison_fill_region | ||
* and multi_heap_internal_check_block_poisoning, these two function will | ||
* be registered to the ROM tlsf IMPL through the function tlsf_poison_fill_pfunc_set() | ||
* and tlsf_poison_check_pfunc_set() when the heap poisoning feature is enabled. | ||
*/ | ||
typedef void (*poison_fill_pfunc_t)(void *start, size_t size, bool is_free); | ||
typedef bool (*poison_check_pfunc_t)(void *start, size_t size, bool is_free, bool print_errors); | ||
|
||
/*! | ||
* @brief Set the function to call for filling memory region when | ||
* poisoning is configured. | ||
* | ||
* @note Please keep in mind that this function in ROM still accepts void*. | ||
* | ||
* @param pfunc The callback function to trigger for poisoning | ||
* a memory region. | ||
*/ | ||
void tlsf_poison_fill_pfunc_set(poison_fill_pfunc_t pfunc); | ||
|
||
/*! | ||
* @brief Set the function to call for checking memory region when | ||
* poisoning is configured. | ||
* | ||
* @param pfunc The callback function to trigger for checking | ||
* the content of a memory region. | ||
*/ | ||
void tlsf_poison_check_pfunc_set(poison_check_pfunc_t pfunc); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters