bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org, Vivien Kraus <vivien@planete-kraus.eu>
Subject: Re: Parameterize the memory allocator for the container library
Date: Thu, 15 Feb 2024 11:04:37 +0100	[thread overview]
Message-ID: <CAEYrNrTSfN_K1m0HhKFUA9NgJZqEoqvc7YHqc4Bam3GPvWzqtg@mail.gmail.com> (raw)
In-Reply-To: <1925299.VZ3vTMCxA0@nimes>

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]

Hi,

If I may chime into the discussion, let me remark that local
parameterization of the memory allocator is often useful (while the linker
approach means a global replacement).  For example, part of the
program/library may work with an arena allocator (see, e.g. [1] for a
general discussion) and containers used in this part of the program should
use the arena allocator instead of the global allocator.

The C++ container types have the ability to use custom allocators (see [2]
for some simple benchmarks).

Best,

Marc

--

[1] https://www.rfleury.com/p/untangling-lifetimes-the-arena-allocator
[2]
https://indiegamedev.net/2022/03/27/custom-c20-memory-allocators-for-stl-containers/

Am Sa., 10. Feb. 2024 um 18:28 Uhr schrieb Bruno Haible <bruno@clisp.org>:

> Hi,
>
> > Is it possible to parameterize the memory allocator for the ordered map
> > library?
>
> 1) What's the use-case?
>
> 2) What's wrong with the approach outlined in
>    https://stackoverflow.com/questions/17803456/ ?
>
> Bruno
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2505 bytes --]

      reply	other threads:[~2024-02-15 10:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-10 17:00 Parameterize the memory allocator for the container library Vivien Kraus
2024-02-10 17:28 ` Bruno Haible
2024-02-15 10:04   ` Marc Nieper-Wißkirchen [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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=CAEYrNrTSfN_K1m0HhKFUA9NgJZqEoqvc7YHqc4Bam3GPvWzqtg@mail.gmail.com \
    --to=marc.nieper+gnu@gmail.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=vivien@planete-kraus.eu \
    /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.
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).