all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: pdumper memory allocation (new FIXME)
Date: Thu, 31 Jan 2019 18:58:46 +0200	[thread overview]
Message-ID: <83k1ikzruh.fsf@gnu.org> (raw)
In-Reply-To: <95d4aa4e-bf2f-d18a-9906-95ab5056f065@cs.ucla.edu> (message from Paul Eggert on Thu, 31 Jan 2019 08:07:01 -0800)

> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: Emacs development discussions <emacs-devel@gnu.org>
> Date: Thu, 31 Jan 2019 08:07:01 -0800
> 
> The call to xstrdup was added in 2019-01-26T10:08:56!eliz@gnu.org 
> (a7974933dd818194de3c9387b95dbd122bcf506c), whose commit message says 
> "Use xstrdup instead of strdup, as on MS-Windows the latter uses the 
> wrong heap." I thought that with pdumper we no longer have a hybrid 
> malloc with two heaps; we simply have the usual C heap. Is that not true 
> in MS-Windows for some reason?

There's only one heap on MS-Windows in the pdumper configuration, but
it is not the heap used by malloc from the C runtime, it's our private
heap we set up in w32heap.c, to better support Emacs memory
allocation.

The original code called strdup, which on Windows calls the default
malloc (because the C runtime was linked against that default malloc
implementation), and then the resulting pointer couldn't be free'd
later, because by the time we free it, we will have already switched
to the private heap.

If this call could cause problems to other platforms (I don't think I
understand why, perhaps Daniel could show me the light), I'm okay with
making the xstrdup call conditioned by WINDOWSNT.  Or we could leak
the dump file name and not free it, although that sounds less clean to
me.



      reply	other threads:[~2019-01-31 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 16:07 pdumper memory allocation (new FIXME) Paul Eggert
2019-01-31 16:58 ` Eli Zaretskii [this message]

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=83k1ikzruh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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.