unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Using mmap on MS-Windows
@ 2013-05-15 14:04 Eli Zaretskii
  2013-05-15 19:10 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2013-05-15 14:04 UTC (permalink / raw)
  To: emacs-devel

The MS-Windows build of Emacs currently uses ralloc.c for allocation
of buffer memory, whereas most of the Posix platforms use mmap.  Using
ralloc.c has disadvantages, of which the most important and painful
one is that we must sometimes prevent buffer memory relocation when
xmalloc is called, and ralloc.c is not well equipped for such
situations, which at best leads to loss of free memory (and at worst
causes random crashes).

OTOH, it should be possible to implement mmap on Windows, at least for
the features that Emacs needs, judging by the mmap flags used by
Emacs.

Would someone please volunteer to work on converting the Windows port
to using mmap?  I can point to a couple of existing implementations of
mmap for Windows, which are GPL or PD, and so can be used at least as
starting points.  The goal would be to use mmap instead of ralloc.c
for buffer memory, and switch to the system malloc (instead of using
gmalloc.c) for all the other needs.

TIA



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

* Re: Using mmap on MS-Windows
  2013-05-15 14:04 Using mmap on MS-Windows Eli Zaretskii
@ 2013-05-15 19:10 ` Stefan Monnier
  2013-05-15 20:37   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-05-15 19:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> Would someone please volunteer to work on converting the Windows port
> to using mmap?

That would be welcome, indeed.  Especially, since I think it would let
us get rid of ralloc.c since I don't think it's used on any
other system.


        Stefan



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

* Re: Using mmap on MS-Windows
  2013-05-15 19:10 ` Stefan Monnier
@ 2013-05-15 20:37   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2013-05-15 20:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: emacs-devel@gnu.org
> Date: Wed, 15 May 2013 15:10:45 -0400
> 
> > Would someone please volunteer to work on converting the Windows port
> > to using mmap?
> 
> That would be welcome, indeed.  Especially, since I think it would let
> us get rid of ralloc.c since I don't think it's used on any
> other system.

It's used on *BSD systems, I think.



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

end of thread, other threads:[~2013-05-15 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 14:04 Using mmap on MS-Windows Eli Zaretskii
2013-05-15 19:10 ` Stefan Monnier
2013-05-15 20:37   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).