From: | genew@mail.ocis.net (Gene Wirchenko) |
Newsgroups: | comp.compilers |
Date: | 2 Jul 2003 00:40:16 -0400 |
Organization: | Posted via Supernews, http://www.supernews.com |
References: | 03-05-211 03-06-015 03-06-054 03-06-057 03-06-078 03-06-106 |
Keywords: | storage |
Posted-Date: | 02 Jul 2003 00:40:16 EDT |
mwotton@cse.unsw.edu.au (Mark Alexander Wotton) wrote:
>On 20 Jun 2003 00:02:55 -0400, Eric posted:
>> mwotton@cse.unsw.edu.au (Mark Alexander Wotton) wrote
[snip]
>> I admit, reference-counting has its problems and I have been toying
>> around with an idea for what I call "compile-time
>> reference-counting". Basically, I am looking for a set of rules,
>> that will allow the compiler to figure out when to release memory
>> for an object, *without* having to allocate memory space for a
>> reference counter value. Instead, using these rules, the compiler
>> can analyse code at compile time and statically work out the
>> life-time of an object. Its a bit wishy washy at the moment but if
>> its at all possible, I will write a paper on it :)
>
>It smells a bit undecidable to me. At least for the complete case, I think
>this reduces to the halting problem.
>
> Object foo(Object x, Object y) {
> if (halts(x)) {
> return y;
> } else {
> return x;
> }
> }
>
>When do you release x's memory?
if branch: yes, else branch: no.
Your code would make sense to me if the return values were
switched. Is that what you meant, or am I missing something?
>You may be able to find some decent heuristics, but I suspect it's a lot
>harder than it looks.
It does have that feel to me, too.
Sincerely,
Gene Wirchenko
Return to the
comp.compilers page.
Search the
comp.compilers archives again.