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: Eli Zaretskii
Subject: Re: When should ralloc.c be used?
Date: Tue, 25 Oct 2016 19:36:54 +0300

> From: Stefan Monnier <address@hidden>
> Date: Tue, 25 Oct 2016 10:12:23 -0400
> 
> >> 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.

Since ralloc.c relocates blocks, it can make this happen more easily.

> > 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.

It makes no sense to release random pages here and there, all you get
is fragmentation at address space level.



reply via email to

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