Hello,
it's me again.
There is a section in the document "emRun User Guide & Reference manual" [UM12007, Date: November 2, 2022] for the runtime library, indicating several functions:
I have tried using them in my code. A search in all project files showed that these functions are marked with the attribute "weak" which means I have to define a function with the same name to use. But it doesn't work. After compilation, these functions are removed (I looked at the map file). At the same time, in the disassembler window, in the same map file, there are functions with names:
Which I could already use in my code like this:
Display All
In this regard, questions:
1. Is there an error in the function description in the documentation?
2. When using the C++ compiler, can these functions be used or are there analogues?
3. How can I control the amount of free heap space? I would like to know how much my application will "eat up" in the worst case scenario and if there are any memory leaks.
thanks
it's me again.
There is a section in the document "emRun User Guide & Reference manual" [UM12007, Date: November 2, 2022] for the runtime library, indicating several functions:
I have tried using them in my code. A search in all project files showed that these functions are marked with the attribute "weak" which means I have to define a function with the same name to use. But it doesn't work. After compilation, these functions are removed (I looked at the map file). At the same time, in the disassembler window, in the same map file, there are functions with names:
Which I could already use in my code like this:
Source Code: main.cpp
- //void __SEGGER_RTL_X_heap_lock(){
- extern "C" void __heap_lock (void){
- printf("lock \n");
- }
- //extern "C" void __SEGGER_RTL_X_heap_unlock(){
- extern "C" void __heap_unlock (void){
- printf("unlock \n");
- }
- class test {
- public:
- test() {
- printf("construct test class\n");
- }
- private:
- };
- int main(void) {
- test* t = new test();
- (void)t;
- for(;;){
- }
- }
1. Is there an error in the function description in the documentation?
2. When using the C++ compiler, can these functions be used or are there analogues?
3. How can I control the amount of free heap space? I would like to know how much my application will "eat up" in the worst case scenario and if there are any memory leaks.
thanks