all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: fabrice.popineau@gmail.com, emacs-devel@gnu.org
Subject: Re: w32/w64 Emacs and gmalloc()
Date: Sat, 01 Mar 2014 09:02:23 +0200	[thread overview]
Message-ID: <831tymwge8.fsf@gnu.org> (raw)
In-Reply-To: <jwv4n3jjgvj.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 28 Feb 2014 12:21:37 -0500
> Cc: emacs-devel@gnu.org
> 
> > Once the preloaded data are dumped, they are not freed nor realloc'ed, or 
> > rather, the space they occupied is not collected.
> 
> What changes did you make to get this result?

Fabrice implemented mmap emulation for Windows, for use in allocating
buffer text, and then uses system malloc for the rest of allocations.

> > This is suboptimal, but there is no way around with the w32 api alone
> > (no way that I know of without  using your own allocator).
> 
> IIUC the problem is with calling "malloc" before the dump and then
> "free" that block after the dump, right?

Yes, that's the problem.

> If so, there's still some room for improvement since Emacs could
> reuse a malloc'd area internally (without going through
> free+malloc).

If Emacs already does that, there's no problem.  What Fabrice wrote
just says that calls to 'free' that reference memory allocated before
dumping will be a no-op, and calls to 'realloc' that enlarge the block
will malloc new memory.



  reply	other threads:[~2014-03-01  7:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 16:39 w32/w64 Emacs and gmalloc() Fabrice Popineau
2014-02-28 17:21 ` Stefan Monnier
2014-03-01  7:02   ` Eli Zaretskii [this message]
2014-03-01 15:50     ` Stefan Monnier
2014-03-01 16:00       ` Fabrice Popineau
2014-03-01 18:08         ` Eli Zaretskii
2014-03-01 20:12           ` Fabrice Popineau
2014-03-01 20:29             ` Eli Zaretskii
2014-03-01 18:05       ` Eli Zaretskii
2014-03-04  3:28         ` Stefan Monnier
2014-03-04  3:49           ` Eli Zaretskii
2014-03-01  6:58 ` Eli Zaretskii
2014-03-01  9:57   ` Fabrice Popineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831tymwge8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.