all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 22086@debbugs.gnu.org
Subject: bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid mallo
Date: Wed, 10 Feb 2016 13:27:37 +0100	[thread overview]
Message-ID: <854mdgpwdx.fsf@iznogoud.viz> (raw)
In-Reply-To: <85poynxvgy.fsf@iznogoud.viz>

On Tue, Feb 09 2016, Paul Eggert wrote:

>> I think, (g)calloc and hybrid_calloc are still needed, though?
>
> I suppose you're right, so I installed your patch in master.

Thanks, I could have pushed it myself, I just posted it here to avoid
interfering with your plans concerning this stuff.

> this stuff is all pretty iffy. Why does Emacs redefine calloc but not
> aligned_alloc or posix_memalign, for example?

Here on FreeBSD 10, in the non-hybrid case both aligned_alloc and
posix_memalign are redefined; in the hybrid case there is only
hybrid_aligned_alloc:

/opt/src/emacs-calloc-non-hybrid;!2;: nm -g src/emacs | grep align
00000000005e4210 R QCalign_to
0000000000b83df8 D _aligned_blocks
0000000000b83df0 D _aligned_blocks_mutex
00000000005c92b0 T aligned_alloc
00000000005c8e70 T galigned_alloc
00000000005c90e0 T memalign
00000000005c90f0 T posix_memalign
/opt/src/emacs-calloc-non-hybrid;!3;: cd ../emacs-calloc-hybrid/
/opt/src/emacs-calloc-hybrid;!4;: nm -g src/emacs | grep align
00000000005e3380 R QCalign_to
                 U aligned_alloc@@FBSD_1.3
00000000005c71a0 T hybrid_aligned_alloc
/opt/src/emacs-calloc-hybrid;!5;: 

> Is it because we know no library uses these newer allocators?

Just for the record, as you know this stuff way better than I do:

IIUC, we need hybrid_ versions for all allocation functions that are
actually used in code statically linked with emacs (at least those which
somewhere refer to memory allocated before dumping, but I don't think
there's much point in making a distinction here).

On the other hand, in the non-hybrid case, we have to override all of
them (if they exist in libc), so that references in shared libraries
linked with emacs to, say, posix_memalign don't resolve to the libc
version.

> Anyway, I suppose it's better to play it safe and continue to redefine
> calloc, the way Emacs has done for decades, until we have a better way
> to do dumping and restoring and memory allocation for such.

In the hybrid case we just do #define calloc hybrid_calloc etc. in the
emacs sources, so that's not a problem.  On the other hand, in the
non-hybrid case, what has been done for decades (i.e. overriding the
libc implementation of calloc etc.) has turned out to be a problem after
all (bug#22085).





      reply	other threads:[~2016-02-10 12:27 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 17:57 bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid malloc patch for elf systems Wolfgang Jenkner
2015-12-16  8:28 ` Paul Eggert
2015-12-16 17:15   ` Rich Felker
2015-12-16 17:47     ` Eli Zaretskii
2015-12-17 13:16   ` Wolfgang Jenkner
2015-12-17 16:17     ` Eli Zaretskii
2015-12-17 16:26     ` Rich Felker
2015-12-18  0:06       ` Wolfgang Jenkner
2015-12-18  6:57         ` Eli Zaretskii
2015-12-18 13:15           ` Wolfgang Jenkner
2015-12-18 14:38             ` Eli Zaretskii
2015-12-20 22:33     ` Paul Eggert
2015-12-21  1:59       ` Rich Felker
2015-12-21  2:37         ` Paul Eggert
2015-12-21  2:51           ` Rich Felker
2015-12-21 11:10             ` Paul Eggert
2015-12-21 18:01               ` Rich Felker
2015-12-23  8:24                 ` Paul Eggert
2015-12-21  3:37       ` Ken Brown
2015-12-21  4:06         ` Rich Felker
2015-12-21 12:24           ` Ken Brown
2015-12-21 20:08           ` Daniel Colascione
2015-12-21 20:49             ` Rich Felker
2015-12-21 20:58               ` Daniel Colascione
2015-12-21  3:44       ` Eli Zaretskii
2015-12-21 11:18         ` Paul Eggert
2015-12-21 15:37           ` Eli Zaretskii
2015-12-21 17:11             ` Paul Eggert
2015-12-21 15:14       ` Wolfgang Jenkner
2015-12-21 15:46         ` Wolfgang Jenkner
2015-12-21 17:06         ` Paul Eggert
2015-12-21 17:28           ` Wolfgang Jenkner
2015-12-23  8:31             ` Paul Eggert
2016-01-30  9:17 ` bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid mallo Paul Eggert
2016-01-30  9:40   ` Eli Zaretskii
2016-01-31  0:43     ` Paul Eggert
2016-01-31 16:51       ` Wolfgang Jenkner
2016-01-31 17:54         ` Paul Eggert
2016-01-31  0:53   ` Rich Felker
2016-02-01 15:15 ` Wolfgang Jenkner
2016-02-01 16:58   ` Paul Eggert
2016-02-01 18:34     ` Wolfgang Jenkner
2016-02-01 19:38       ` Eli Zaretskii
2016-02-01 23:08         ` Paul Eggert
2016-02-09 14:55 ` Wolfgang Jenkner
2016-02-09 23:31 ` Paul Eggert
2016-02-10 12:27   ` Wolfgang Jenkner [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=854mdgpwdx.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=22086@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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.