mailing list of musl libc
 help / color / mirror / code / Atom feed
From: gilles@poolp.org
To: "Florian Weimer" <fw@deneb.enyo.de>
Cc: musl@lists.openwall.com
Subject: Re: freeaddrinfo() comments and questions
Date: Sat, 23 Nov 2019 16:31:35 +0000	[thread overview]
Message-ID: <9a9f93674d04ac477e556a307b91ac54@poolp.org> (raw)
In-Reply-To: <87v9ra7f42.fsf@mid.deneb.enyo.de>

November 23, 2019 5:05 PM, "Florian Weimer" <fw@deneb.enyo.de> wrote:

> * gilles:
> 
>> In these other implementations, it is possible to write a custom
>> struct addrinfo allocator and use freeaddrinfo() on it, just like it
>> is possible to use getaddrinfo() and use a custom release function on
>> it. This is not a very common use-case, granted, but it is one
>> nonetheless, and one that works and has worked in a portable way for a
>> long time across a wide variety of systems.
> 
> I think this is clearly undefined. There is no way to know how
> storage for ai_addr and ai_canonname is managed. These pointers could
> point to separate allocations, made with malloc. They could be
> interior pointers to the same top-level allocation at which start the
> struct addrinfo object is allocated. Nothing even needs to use
> malloc, including the outer struct addrinfo object.

Fair enough for this use-case, I think you are right and it works by accident.

What is your opinion on the other comments ?


  parent reply	other threads:[~2019-11-23 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 15:46 gilles
2019-11-23 16:05 ` Florian Weimer
2019-11-23 17:41   ` Rich Felker
2019-11-23 16:31 ` gilles [this message]
2019-11-23 16:50   ` Florian Weimer
2019-11-23 17:48     ` Rich Felker

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=9a9f93674d04ac477e556a307b91ac54@poolp.org \
    --to=gilles@poolp.org \
    --cc=fw@deneb.enyo.de \
    --cc=musl@lists.openwall.com \
    /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 public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).