Kconfig 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. menu "Heap memory debugging"
  2. choice HEAP_CORRUPTION_DETECTION
  3. prompt "Heap corruption detection"
  4. default HEAP_POISONING_DISABLED
  5. help
  6. Enable heap poisoning features to detect heap corruption caused by out-of-bounds access to heap memory.
  7. See the "Heap Memory Debugging" page of the IDF documentation
  8. for a description of each level of heap corruption detection.
  9. config HEAP_POISONING_DISABLED
  10. bool "Basic (no poisoning)"
  11. config HEAP_POISONING_LIGHT
  12. bool "Light impact"
  13. config HEAP_POISONING_COMPREHENSIVE
  14. bool "Comprehensive"
  15. endchoice
  16. choice HEAP_TRACING_DEST
  17. bool "Heap tracing"
  18. default HEAP_TRACING_OFF
  19. help
  20. Enables the heap tracing API defined in esp_heap_trace.h.
  21. This function causes a moderate increase in IRAM code side and a minor increase in heap function
  22. (malloc/free/realloc) CPU overhead, even when the tracing feature is not used.
  23. So it's best to keep it disabled unless tracing is being used.
  24. config HEAP_TRACING_OFF
  25. bool "Disabled"
  26. config HEAP_TRACING_STANDALONE
  27. bool "Standalone"
  28. select HEAP_TRACING
  29. config HEAP_TRACING_TOHOST
  30. bool "Host-based"
  31. select HEAP_TRACING
  32. endchoice
  33. config HEAP_TRACING
  34. bool
  35. default F
  36. help
  37. Enables/disables heap tracing API.
  38. config HEAP_TRACING_STACK_DEPTH
  39. int "Heap tracing stack depth"
  40. range 0 0 if IDF_TARGET_ARCH_RISCV # Disabled for RISC-V due to `__builtin_return_address` limitation
  41. default 0 if IDF_TARGET_ARCH_RISCV
  42. range 0 32
  43. default 2
  44. depends on HEAP_TRACING
  45. help
  46. Number of stack frames to save when tracing heap operation callers.
  47. More stack frames uses more memory in the heap trace buffer (and slows down allocation), but
  48. can provide useful information.
  49. config HEAP_USE_HOOKS
  50. bool "Use allocation and free hooks"
  51. help
  52. Enable the user to implement function hooks triggered for each successful allocation and free.
  53. config HEAP_TASK_TRACKING
  54. bool "Enable heap task tracking"
  55. depends on !HEAP_POISONING_DISABLED
  56. help
  57. Enables tracking the task responsible for each heap allocation.
  58. This function depends on heap poisoning being enabled and adds four more bytes of overhead for each block
  59. allocated.
  60. config HEAP_TRACE_HASH_MAP
  61. bool "Use hash map mechanism to access heap trace records"
  62. depends on HEAP_TRACING_STANDALONE
  63. default n
  64. help
  65. Enable this flag to use a hash map to increase performance in handling
  66. heap trace records.
  67. Heap trace standalone supports storing records as a list, or a list + hash map.
  68. Using only a list takes less memory, but calls to 'free' will get slower as the
  69. list grows. This is particularly affected when using HEAP_TRACE_ALL mode.
  70. By using a list + hash map, calls to 'free' remain fast, at the cost of
  71. additional memory to store the hash map.
  72. config HEAP_TRACE_HASH_MAP_IN_EXT_RAM
  73. bool "Place hash map in external RAM"
  74. depends on HEAP_TRACE_HASH_MAP
  75. default n
  76. help
  77. When enabled this configuration forces the hash map to be placed in external RAM.
  78. config HEAP_TRACE_HASH_MAP_SIZE
  79. int "The number of entries in the hash map"
  80. depends on HEAP_TRACE_HASH_MAP
  81. default 512
  82. help
  83. Defines the number of entries in the heap trace hashmap. Each entry takes 8 bytes.
  84. The bigger this number is, the better the performance. Recommended range: 200 - 2000.
  85. config HEAP_ABORT_WHEN_ALLOCATION_FAILS
  86. bool "Abort if memory allocation fails"
  87. default n
  88. help
  89. When enabled, if a memory allocation operation fails it will cause a system abort.
  90. config HEAP_TLSF_USE_ROM_IMPL
  91. bool "Use ROM implementation of heap tlsf library"
  92. depends on ESP_ROM_HAS_HEAP_TLSF
  93. default y
  94. help
  95. Enable this flag to use heap functions from ROM instead of ESP-IDF.
  96. If keeping this as "n" in your project, you will have less free IRAM.
  97. If making this as "y" in your project, you will increase free IRAM,
  98. but you will lose the possibility to debug this module, and some new
  99. features will be added and bugs will be fixed in the IDF source
  100. but cannot be synced to ROM.
  101. config HEAP_PLACE_FUNCTION_INTO_FLASH
  102. bool "Force the entire heap component to be placed in flash memory"
  103. depends on !HEAP_TLSF_USE_ROM_IMPL
  104. default n
  105. help
  106. Enable this flag to save up RAM space by placing the heap component in the flash memory
  107. Note that it is only safe to enable this configuration if no functions from esp_heap_caps.h
  108. or esp_heap_trace.h are called from ISR.
  109. endmenu