rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* memory leaks
@ 1992-08-13  2:08 Scott Schwartz
  1992-08-13  4:32 ` John Mackin
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Schwartz @ 1992-08-13  2:08 UTC (permalink / raw)
  To: rc

Is anyone (besides me) concerned about the memory leaks in rc1.4?  If
you hit ^C you can watch your process size go up.  Depressing.  What do
other shells do about this?

-- Scott


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re:  memory leaks
@ 1992-08-13  3:44 Byron Rakitzis
  1992-08-13  7:28 ` Scott Schwartz
  0 siblings, 1 reply; 7+ messages in thread
From: Byron Rakitzis @ 1992-08-13  3:44 UTC (permalink / raw)
  To: rc, uunet!groucho.cs.psu.edu!schwartz

>Is anyone (besides me) concerned about the memory leaks in rc1.4?

I'm always interested in patching up a memory leak in rc.

>What do other shells do about this?

Presumably they don't leak.

>Depressing.  

Well, instead of being depressed about it you could send me some mail
with a full bug report.

I just looked at my rc-1.4 and I could not get it to leak on ^C. If you
gave described the problem in full (are you using readline, maybe a
prompt function doing something funny, etc.?) maybe somebody could do
something about it.

(BTW, I hate to say this, but it peeves me a bit that you refer to the
leak in the plural. Perhaps there is more than one memory leak left in
rc, but you only mentioned one in your mail. If you're going to talk
about memory leaks in the plural at least you could point out how to
tickle them.)

Byron.


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: memory leaks
@ 1992-08-13 13:34 Chet Ramey
  0 siblings, 0 replies; 7+ messages in thread
From: Chet Ramey @ 1992-08-13 13:34 UTC (permalink / raw)
  To: schwartz; +Cc: rc, chet

> Is anyone (besides me) concerned about the memory leaks in rc1.4?  If
> you hit ^C you can watch your process size go up.  Depressing.  What do
> other shells do about this?

Bash has a fairly nice `unwind-protect' mechanism.  The interrupt handler
runs the unwind-protect list.  Bash is full of calls like

	begin_unwind_frame("tag");
	add_unwind_protect(free, string1);
	add_unwind_protect(close, openfd);
	add_unwind_protect (restore_signal_mask, oset);

		...

	run_unwind_frame("tag");

Look in the source file `unwind_prot.c' in the bash distribution.

ash and sh have a mechanism to `mark the stack' when allocating memory.
Then when they want to free it, they just unwind back to the previous
mark.

Chet

--
``The use of history as therapy means the corruption of history as history.''
	-- Arthur Schlesinger

Chet Ramey, Case Western Reserve University	Internet: chet@po.CWRU.Edu


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

end of thread, other threads:[~1992-08-13 13:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-08-13  2:08 memory leaks Scott Schwartz
1992-08-13  4:32 ` John Mackin
1992-08-13  7:56   ` Scott Schwartz
1992-08-13 10:30     ` Mark-Jason Dominus
1992-08-13  3:44 Byron Rakitzis
1992-08-13  7:28 ` Scott Schwartz
1992-08-13 13:34 Chet Ramey

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