Skip to content

Commit

Permalink
procfs/meminfo: free delaylist for PROTECTED
Browse files Browse the repository at this point in the history
This triggers `mm_free_delaylist()` before dumping status in PROTECTED
build, otherwise the `free` command still shows delaylist as `used`.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 committed Aug 2, 2024
1 parent 3521952 commit 3377729
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/procfs/fs_procfsmeminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer,
buffer += copysize;
buflen -= copysize;

#ifdef CONFIG_BUILD_PROTECTED
/* Trigger reclamation of delay list otherwise they will be
* counted as used, which often confuses people like memory
* leakages. see pull/12817 for more information.
*/

mm_free_delaylist(entry->heap);
#endif
/* Show heap information */

info = mm_mallinfo(entry->heap);
Expand Down

0 comments on commit 3377729

Please sign in to comment.