aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-05-01 13:06:33 +0300
committerEli Zaretskii2022-05-01 13:06:33 +0300
commit8734d60b053852a6cf4dca59da4c5876820fa7d2 (patch)
treedfbb1c1e7fdd35862e4fdb17afa1dbe1ed31315a
parent29f3d4d2c69a0e9d2ab0a13ee6952fa9cf4d6035 (diff)
downloademacs-8734d60b053852a6cf4dca59da4c5876820fa7d2.tar.gz
emacs-8734d60b053852a6cf4dca59da4c5876820fa7d2.zip
Improve documentation of 'malloc-trim'
* src/alloc.c (Fmalloc_trim): Fix the doc string. * etc/NEWS: Document which systems support 'malloc-trim'.
-rw-r--r--etc/NEWS3
-rw-r--r--src/alloc.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 371fbc2145a..fc7432669c3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1547,7 +1547,8 @@ functions.
1547--- 1547---
1548** New function 'malloc-trim'. 1548** New function 'malloc-trim'.
1549This function allows returning unused memory back to the operating 1549This function allows returning unused memory back to the operating
1550system, and is mainly meant as a debugging tool. 1550system, and is mainly meant as a debugging tool. It is currently
1551available only when Emacs was built with glibc as the C library.
1551 1552
1552--- 1553---
1553** 'x-show-tip' no longer hard-codes a timeout default. 1554** 'x-show-tip' no longer hard-codes a timeout default.
diff --git a/src/alloc.c b/src/alloc.c
index 661f37dd5cc..43fbbb79bed 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7481,14 +7481,14 @@ arenas. */)
7481 7481
7482#ifdef HAVE_MALLOC_TRIM 7482#ifdef HAVE_MALLOC_TRIM
7483DEFUN ("malloc-trim", Fmalloc_trim, Smalloc_trim, 0, 1, "", 7483DEFUN ("malloc-trim", Fmalloc_trim, Smalloc_trim, 0, 1, "",
7484 doc: /* Release free memory from the heap. 7484 doc: /* Release free heap memory to the OS.
7485This function asks libc to return unused memory back to the operating 7485This function asks libc to return unused heap memory back to the operating
7486system. This function isn't guaranteed to do anything, and is mainly 7486system. This function isn't guaranteed to do anything, and is mainly
7487meant as a debugging tool. 7487meant as a debugging tool.
7488 7488
7489If LEAVE_PADDING is given, ask the system to leave that much unused 7489If LEAVE_PADDING is given, ask the system to leave that much unused
7490spaced in the heap. This should be an integer, and if not given, 7490space in the heap of the Emacs process. This should be an integer, and if
7491defaults to 0. 7491not given, it defaults to 0.
7492 7492
7493This function returns nil if no memory could be returned to the 7493This function returns nil if no memory could be returned to the
7494system, and non-nil if some memory could be returned. */) 7494system, and non-nil if some memory could be returned. */)