zsh-workers
 help / color / mirror / code / Atom feed
* Another missing HEAPALLOC
@ 1996-12-10  8:57 Peter Stephenson
  1996-12-11  0:56 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1996-12-10  8:57 UTC (permalink / raw)
  To: Zsh hackers list

% echo $zs
/home/sgi/pws/src/zsh-3.0.1/Src
% cd zs
BUG: permanent allocation in getstrvalue
~zs

PERMALLOC is set in bin_cd for calling cd_get_dest(), but the
parameter code in getnamedir() needs HEAPALLOC.  (Is this
getstrvalue() test new?  I've only just started noticing the error
messages.)  The following patch is chosen simply to make the minimum
code reorganisation necessary, but maybe the HEAPALLOC needs to be
further down in getstrvalue() or wherever, as Zoltan suggested.

*** Src/builtin.c~	Mon Dec  9 17:57:22 1996
--- Src/builtin.c	Tue Dec 10 09:48:52 1996
***************
*** 1180,1186 ****
  	for (rest = s; *rest && *rest != '/'; rest++);
  	save = *rest;
  	*rest = 0;
! 	s = getnameddir(s);
  	*rest = save;
  
  	if (s && *rest)
--- 1180,1188 ----
  	for (rest = s; *rest && *rest != '/'; rest++);
  	save = *rest;
  	*rest = 0;
! 	HEAPALLOC {
! 	    s = getnameddir(s);
! 	} LASTALLOC;
  	*rest = save;
  
  	if (s && *rest)

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Another missing HEAPALLOC
  1996-12-10  8:57 Another missing HEAPALLOC Peter Stephenson
@ 1996-12-11  0:56 ` Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-12-11  0:56 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

> PERMALLOC is set in bin_cd for calling cd_get_dest(), but the
> parameter code in getnamedir() needs HEAPALLOC.  (Is this
> getstrvalue() test new?  I've only just started noticing the error
> messages.)  The following patch is chosen simply to make the minimum
> code reorganisation necessary, but maybe the HEAPALLOC needs to be
> further down in getstrvalue() or wherever, as Zoltan suggested.

Yes, this check in getstrvalue() is new.  I added this after Hrvoje Niksic
(it I remember correctly) discovered this memory leak with purify.  I have
changed it to USEHEAP as it seems to be more appropriate now, but it was
proved to quite useful as it allowed me to discover that zlogout scripts
are called with permalloc in effect when the shell exited with a zle
timeout (that's because I do not use zlogout but getsparam("HISTFILE")
invoked this warning).

Zoltan


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-12-11  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-12-10  8:57 Another missing HEAPALLOC Peter Stephenson
1996-12-11  0:56 ` Zoltan Hidvegi

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).