Waitrud Weber’s blog

things and reminders for memories

CodeAnalyzer: windows-make: Print memories:

Print memories is well and set the message level param.
From the under the sub lootin like "char* copyof_002 ( char* str )", we can revise the retunable value by use of memorization control in this case "p|003C1140|:dummy_ary[0]=|abc|".

 

s_a, s_b and s_c are returnable and allocated under the sub level functions.
The returnable values should be memorized in global in alocaltion areas which means not local at all but extern and filed in C language.
That means at the least leve 3 are there as memories blocks in C language.

(char*) s_a <- malloc
(char*) s_b <- char_string
(char*) s_c <- copyof_002

 

- - - -
1      
2

.\array_counter.cpp  Wed Jul 13 11:00:20 2022

...
825 :char* copyof_002 ( char* str ) {
826 :    printf("char* copyof_002 ( char* str ) starts.\r\n");
827 :    int ac = array_count(str);
828 :    printf("array_count %d\r\n", ac );
829 :    dummy_allocation_001 = char_string_002 ( ac + 1 );
830 :    a_sleep_thread_002 ();
831 :    if ( dummy_allocation_001 == NULL ) {
832 :        printf("dummy_allocation_001 is null.\r\n");
833 :        exit(-1);
834 :    }
835 :    printf("dummy_allocation_001 point|%p|\r\n", dummy_allocation_001 );
836 ://    put_memories( dummy_allocation_001 );
837 :
838 :    for ( int i=0; i<ac; i++) {
839 :        dummy_allocation_001[i] = str[i];
840 :    }
841 :
842 :    dummy_allocation_001[ac] = '\0';
843 :    printf("str |%p| dummy_allocation_001 |%p|\r\n", str, dummy_allocation_001 );
844 :    printf("char* copyof_002 ( char* str ) ends.\r\n");
845 :    return dummy_allocation_001;
846 :}
...

   
3 --- execution 001 ---
> .\winmain_001.exe
char* copyof_002 ( char* str ) starts.
array_count 3
char* char_string_002 ( int num_memories ) starts. dummy_allocation_001=00000000
void print_memories_002 () starts.
void print_memories_002 () ends.
character i 0/10 num_memories 4 about|00000000|
dummy_allocation_001|003C1140|
char** put_memories_002 ( char* str ) starts. index 0: index_max 0
char** put_memories_002 ( char* str ) ends.
char* char_string_002 ( int num_memories ) ends.
a_sleep_thread_002 starts.
a_sleep_thread_002 ends.
dummy_allocation_001 point|003C1140|
str |004171F8| dummy_allocation_001 |003C1140|
char* copyof_002 ( char* str ) ends.
p_dummy_token|003C1140|=|abc| p_dummy|004171F8|=|abc|
void print_memories_002 () starts.
p|003C1140|:dummy_ary[0]=|abc|
void print_memories_002 () ends.
--- execution 001 ---
   
4      
5      

 

*