]> git.sur5r.net Git - freertos/commitdiff
Add traceMALLOC() and traceFREE() macros.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 4 Oct 2013 20:56:45 +0000 (20:56 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 4 Oct 2013 20:56:45 +0000 (20:56 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2049 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/portable/MemMang/heap_1.c
FreeRTOS/Source/portable/MemMang/heap_2.c
FreeRTOS/Source/portable/MemMang/heap_3.c
FreeRTOS/Source/portable/MemMang/heap_4.c

index 1ec4e96b05a439576f4095582820d8c0692840dd..2b2d5d625f2627476fc4c795601cf4431cc9f1ef 100644 (file)
@@ -122,7 +122,9 @@ static unsigned char *pucAlignedHeap = NULL;
                        pvReturn = pucAlignedHeap + xNextFreeByte;\r
                        xNextFreeByte += xWantedSize;\r
                }\r
-       }\r
+\r
+               traceMALLOC( pvReturn, xWantedSize );\r
+       }       \r
        xTaskResumeAll();\r
 \r
        #if( configUSE_MALLOC_FAILED_HOOK == 1 )\r
index ab08b2faacb07a21ecd9500bdabe0ddcc3a78e3c..1aaa63bbf1418da0e523a2986556be96cc724c58 100644 (file)
@@ -214,6 +214,8 @@ void *pvReturn = NULL;
                                xFreeBytesRemaining -= pxBlock->xBlockSize;\r
                        }\r
                }\r
+               \r
+               traceMALLOC( pvReturn, xWantedSize );\r
        }\r
        xTaskResumeAll();\r
 \r
@@ -251,6 +253,7 @@ xBlockLink *pxLink;
                        /* Add this block to the list of free blocks. */\r
                        prvInsertBlockIntoFreeList( ( ( xBlockLink * ) pxLink ) );\r
                        xFreeBytesRemaining += pxLink->xBlockSize;\r
+                       traceFREE( pv, pxLink->xBlockSize );\r
                }\r
                xTaskResumeAll();\r
        }\r
index b4a0a2fe4eb9766f63aceb6ab4be224be63fa8d1..bd6683886cf289497b1457bac8a00800ccad1f4f 100644 (file)
@@ -95,6 +95,7 @@ void *pvReturn;
        vTaskSuspendAll();\r
        {\r
                pvReturn = malloc( xWantedSize );\r
+               traceMALLOC( pvReturn, xWantedSize );\r
        }\r
        xTaskResumeAll();\r
 \r
@@ -119,6 +120,7 @@ void vPortFree( void *pv )
                vTaskSuspendAll();\r
                {\r
                        free( pv );\r
+                       traceFREE( pv, 0 );\r
                }\r
                xTaskResumeAll();\r
        }\r
index 4681ad02f4b15e653380ffc03fdfc0a44eb5c921..8de666d0b728d078d159b72b15eda75411934c48 100644 (file)
@@ -229,6 +229,8 @@ void *pvReturn = NULL;
                                }\r
                        }\r
                }\r
+\r
+               traceMALLOC( pvReturn, xWantedSize );\r
        }\r
        xTaskResumeAll();\r
 \r
@@ -277,6 +279,7 @@ xBlockLink *pxLink;
                                        /* Add this block to the list of free blocks. */\r
                                        xFreeBytesRemaining += pxLink->xBlockSize;\r
                                        prvInsertBlockIntoFreeList( ( ( xBlockLink * ) pxLink ) );\r
+                                       traceFREE( pv, pxLink->xBlockSize );\r
                                }\r
                                xTaskResumeAll();\r
                        }\r