emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When should ralloc.c be used?


From: Stefan Monnier
Subject: Re: When should ralloc.c be used?
Date: Tue, 25 Oct 2016 10:12:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux)

>> That's why I said "basically".  Yes, in theory it can sometimes
>> return memory.  In practice, this is rare.  In contrast, with mmap,
>> returning memory to the OS is the rule rather than the exception.
> How so?  Releasing memory in both cases requires basically the same
> situation: a large enough block of contiguous memory not in use.

IIUC releasing memory with sbrk can only be done if that memory is at
the end of the heap.

> It seems ralloc is actually at an advantage, because relocating blocks
> helps collect together a larger free block.

mmap can always free what it has allocated before, without any need to
relocate anything.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]