File indexing completed on 2025-05-11 08:24:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifdef HAVE_CONFIG_H
0013 #include "config.h"
0014 #endif
0015
0016 #include <inttypes.h>
0017 #include <string.h>
0018
0019 #include <rtems.h>
0020 #include <rtems/malloc.h>
0021 #include <rtems/libcsupport.h>
0022 #include <rtems/shellconfig.h>
0023
0024 #include "internal.h"
0025
0026 static int rtems_shell_main_malloc_info(
0027 int argc,
0028 char *argv[]
0029 )
0030 {
0031 if ( argc == 2 && strcmp( argv[ 1 ], "walk" ) == 0 ) {
0032 malloc_walk( 0, true );
0033 } else {
0034 Heap_Information_block info;
0035
0036 rtems_shell_print_unified_work_area_message();
0037 malloc_info( &info );
0038 rtems_shell_print_heap_info( "free", &info.Free );
0039 rtems_shell_print_heap_info( "used", &info.Used );
0040 rtems_shell_print_heap_stats( &info.Stats );
0041 }
0042
0043 return 0;
0044 }
0045
0046 rtems_shell_cmd_t rtems_shell_MALLOC_INFO_Command = {
0047 "malloc",
0048 "malloc [walk]",
0049 "mem",
0050 rtems_shell_main_malloc_info,
0051 NULL,
0052 NULL
0053 };
0054