Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [patch] malloc_trim.3: Remove mentioning of free call
@ 2021-02-01 10:42 Dmitry Vorobev
  2021-02-01 12:07 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Vorobev @ 2021-02-01 10:42 UTC (permalink / raw)
  To: linux-man; +Cc: alx.manpages, mtk.manpages

'malloc_trim' was and is never called from the 'free' function. see
related bug in glibc tracker:
https://sourceware.org/bugzilla/show_bug.cgi?id=2531. or '__int_free'
function. Only the top part of the heap is trimmed after some calls to
'free', which is different from 'malloc_trim' which also releases
memory in between chunks from all the arenas/heaps.

diff --git a/man3/malloc_trim.3 b/man3/malloc_trim.3
index 3c4cf5e8b..84e73fd70 100644
--- a/man3/malloc_trim.3
+++ b/man3/malloc_trim.3
@@ -80,15 +80,6 @@ T} Thread safety MT-Safe
 .SH CONFORMING TO
 This function is a GNU extension.
 .SH NOTES
-This function is automatically called by
-.BR free (3)
-in certain circumstances; see the discussion of
-.B M_TOP_PAD
-and
-.B M_TRIM_THRESHOLD
-in
-.BR mallopt (3).
-.PP
 Only the main heap (using
 .BR sbrk (2))
 honors the

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] malloc_trim.3: Remove mentioning of free call
  2021-02-01 10:42 [patch] malloc_trim.3: Remove mentioning of free call Dmitry Vorobev
@ 2021-02-01 12:07 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-01 12:07 UTC (permalink / raw)
  To: Dmitry Vorobev, linux-man; +Cc: mtk.manpages, alx.manpages

Hello Dmitry,

On 2/1/21 11:42 AM, Dmitry Vorobev wrote:
> 'malloc_trim' was and is never called from the 'free' function. see
> related bug in glibc tracker:
> https://sourceware.org/bugzilla/show_bug.cgi?id=2531. or '__int_free'
> function. Only the top part of the heap is trimmed after some calls to
> 'free', which is different from 'malloc_trim' which also releases
> memory in between chunks from all the arenas/heaps.

Thanks. I wrote that sentence, but looking back, I must
have been confused.

I've applied your patch.

Cheers,

Michael

> diff --git a/man3/malloc_trim.3 b/man3/malloc_trim.3
> index 3c4cf5e8b..84e73fd70 100644
> --- a/man3/malloc_trim.3
> +++ b/man3/malloc_trim.3
> @@ -80,15 +80,6 @@ T} Thread safety MT-Safe
>  .SH CONFORMING TO
>  This function is a GNU extension.
>  .SH NOTES
> -This function is automatically called by
> -.BR free (3)
> -in certain circumstances; see the discussion of
> -.B M_TOP_PAD
> -and
> -.B M_TRIM_THRESHOLD
> -in
> -.BR mallopt (3).
> -.PP
>  Only the main heap (using
>  .BR sbrk (2))
>  honors the
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 10:42 [patch] malloc_trim.3: Remove mentioning of free call Dmitry Vorobev
2021-02-01 12:07 ` Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git