diff options
| -rw-r--r-- | os/common/oslib/include/chheap.h | 2 | ||||
| -rw-r--r-- | readme.txt | 2 | 
2 files changed, 3 insertions, 1 deletions
diff --git a/os/common/oslib/include/chheap.h b/os/common/oslib/include/chheap.h index 7c85efe7f..6cce85b3c 100644 --- a/os/common/oslib/include/chheap.h +++ b/os/common/oslib/include/chheap.h @@ -173,7 +173,7 @@ static inline void *chHeapAlloc(memory_heap_t *heapp, size_t size) {   */
  static inline size_t chHeapGetSize(const void *p) {
 -  return ((heap_header_t *)p)->used.size;
 +  return ((heap_header_t *)p - 1U)->used.size;
  }
  #endif /* CH_CFG_USE_HEAP == TRUE */
 diff --git a/readme.txt b/readme.txt index 5cf5c6b86..ac083134d 100644 --- a/readme.txt +++ b/readme.txt @@ -155,6 +155,8 @@         Updated the various platform.mk implementing "smart build" mode.
  - HAL: Fixed DAC CH2 marked as not present in STM32F091 registry (bug #905)
         (backported to 17.6.4 and 16.1.10).
 +- LIB: Fixed chHeapGetSize value is not obtained from the header (bug #904)
 +       (backported to 17.6.4).
  - HAL: Fixed ADC does not build on STM32F030 (bug #903)(backported to 17.6.4).
  - LIB: Fixed typo for function evtStop (bug #897)(backported to 17.6.4
         and 16.1.10).
  | 
