[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Re: malloc wrappers
From: |
Bruno Haible |
Subject: |
[Bug-gnulib] Re: malloc wrappers |
Date: |
Mon, 24 Nov 2003 12:56:26 +0100 |
User-agent: |
KMail/1.5 |
Paul Eggert wrote:
> While we're on the subject, ideally there would be a way for the
> application and for library modules to say something like this: "here
> are the properties I need for malloc: it must never return NULL unless
> it's really out of storage, and it must never allocate SIZE_MAX or
> more bytes". At link-time, gnulib would select the proper malloc
> wrapper for each application, by taking the union of all the
> requirements. I don't know of any easy way to implement this,
> unfortunately.
A clean way to implement this is to define a name for each of these
variants of malloc, like zerofixed_malloc, ptrdiff_safe_malloc, etc.,
and let each module explicitly use the one it needs.
That's the way that has been started with calloc(), xmalloc() etc.,
and it works well.
Bruno
- [Bug-gnulib] drop unlocked-io dependency in getline module?, Simon Josefsson, 2003/11/20
- Re: [Bug-gnulib] drop unlocked-io dependency in getline module?, Karl Berry, 2003/11/20
- Re: [Bug-gnulib] drop unlocked-io dependency in getline module?, Bruno Haible, 2003/11/20
- [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Simon Josefsson, 2003/11/20
- Re: [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Jim Meyering, 2003/11/20
- Re: [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Paul Eggert, 2003/11/20
- [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Simon Josefsson, 2003/11/21
- [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Paul Eggert, 2003/11/24
- [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Simon Josefsson, 2003/11/24
- [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Paul Eggert, 2003/11/24
- [Bug-gnulib] Re: malloc wrappers,
Bruno Haible <=
- [Bug-gnulib] Re: malloc wrappers, Paul Eggert, 2003/11/24
- Re: [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Bruno Haible, 2003/11/24
- Re: [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Paul Eggert, 2003/11/24
- Re: [Bug-gnulib] Re: drop unlocked-io dependency in getline module?, Bruno Haible, 2003/11/20
Re: [Bug-gnulib] drop unlocked-io dependency in getline module?, Karl Berry, 2003/11/20