* Size zero allocations
@ 2001-03-06 17:13 Bart Schaefer
2001-03-06 17:27 ` Dan Nelson
0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-03-06 17:13 UTC (permalink / raw)
To: zsh-workers
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?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Size zero allocations
2001-03-06 17:13 Size zero allocations Bart Schaefer
@ 2001-03-06 17:27 ` Dan Nelson
0 siblings, 0 replies; 4+ messages in thread
From: Dan Nelson @ 2001-03-06 17:27 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-workers
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Size zero allocations
@ 2001-03-07 10:09 Sven Wischnowsky
2001-03-25 21:22 ` Bart Schaefer
0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2001-03-07 10:09 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> 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?
Well, adding an empty string to the kill ring doesn't seem to make
much sense... maybe we should just add a `if (!ct) return;' to cut()
(in zle_utils.c)?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-03-25 21:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-06 17:13 Size zero allocations Bart Schaefer
2001-03-06 17:27 ` Dan Nelson
2001-03-07 10:09 Sven Wischnowsky
2001-03-25 21:22 ` Bart Schaefer
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).