From: Dan Nelson <dnelson@emsphone.com>
To: Bart Schaefer <schaefer@candle.brasslantern.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: Size zero allocations
Date: Tue, 6 Mar 2001 11:27:16 -0600 [thread overview]
Message-ID: <20010306112715.C22200@dan.emsphone.com> (raw)
In-Reply-To: <1010306171335.ZM10796@candle.brasslantern.com>; from "Bart Schaefer" on Tue Mar 6 17:13:34 GMT 2001
In the last episode (Mar 06), Bart Schaefer said:
> Press kill-whole-line at an empty prompt, and ElectricFence reports:
>
> zagzig% ^U
> ElectricFence Aborting: Allocating 0 bytes, probably a bug.
>
> Is this, in fact, a bug?
Probably. The Single Unix specs read:
If the size of the space requested is 0, the behaviour is
implementation-dependent; the value returned will be either a null
pointer or a unique pointer.
FreeBSD's malloc can be configured to return either (it defaults to
returning a pointer to a 0-byte malloc structure), and comments:
It can be argued that returning a null pointer when asked to
allocate zero bytes is a silly response to a silly question.
Tru64 returns NULL, and Solaris 8's manpage seems to imply that it
returns a pointer.
--
Dan Nelson
dnelson@emsphone.com
next prev parent reply other threads:[~2001-03-06 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-06 17:13 Bart Schaefer
2001-03-06 17:27 ` Dan Nelson [this message]
2001-03-07 10:09 Sven Wischnowsky
2001-03-25 21:22 ` Bart Schaefer
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=20010306112715.C22200@dan.emsphone.com \
--to=dnelson@emsphone.com \
--cc=schaefer@candle.brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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/zsh/
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).