Newsgroups: comp.lang.misc,comp.object,comp.lang.scheme,comp.lang.functional,comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!delmarva.com!news-out.internetmci.com!internetMCI!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netcom.com!wallace
From: wallace@netcom.com (David E. Wallace)
Subject: Re: (debunk-myth '(debunk-myth '(<-efficient gc malloc/free)))
Message-ID: <wallaceDHACDo.yu@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <QOBI.95Oct22061418@qobi.ai> <46dm26$if4@jive.cs.utexas.edu> <QOBI.95Oct22124417@qobi.ai> <DH0GMA.A9w@cadence.com>
Date: Mon, 30 Oct 1995 23:39:24 GMT
Lines: 25
Sender: wallace@netcom7.netcom.com
Xref: glinda.oz.cs.cmu.edu comp.lang.misc:23588 comp.object:40065 comp.lang.scheme:14202 comp.lang.functional:6619 comp.lang.dylan:5747

In article <DH0GMA.A9w@cadence.com>, Simon Kinahan  <simonk> wrote:
>qobi@qobi.ai (Jeffrey Mark Siskind) wrote:
>>1. *Extremely* short-lived objects that result from using a function style.
>>   Something like the matrix passed between M* and M+ in (M+ (M* A X) Y).
>
>I agree with you about these. It should be exceptionally easy to spot them
>at compile time, because they usually have not even one reference at
>their own level in the program. What would you recommend though ? I am
>tempted to say that they could be noted somehow as 'one use only'
>and cleaned up when the recieving function (M+ here) returns.

I'm not so sure about this.  What do you do if M* usually returns
a temporary, but sometimes may return a persistent object?  For example,
suppose the code for M* looks something like (using my somewhat rusty
Lisp):
  (cond ((or (zerop A) (zerop X)) *ZeroMatrix*)
	((identityp A) X)
	((identityp X) A)
	(t (compute-product A X)))

Then you only want to free the result when M+ returns if it was computed
using the default clause, but not otherwise.  Is this still going
to be so easy to spot at compile-time?
-- 
Dave Wallace		(wallace@netcom.com)
