[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Object identity
From: |
Stefan Monnier |
Subject: |
Re: Object identity |
Date: |
Tue, 21 Oct 2003 16:50:20 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>> I still have no clue what it's useful for, so I tend to find such research
>> rather pointless. But I'm probably just missing the point.
> The OP explained what it's useful for: emulating weak hash tables in a
> system that doesn't have them built in.
That's not how I understood his article. He seemed to say that he
currently uses an implementation of object-identity which relies
on a weak hash-table but that his Emacs's doesn't implement weakness.
I.e. he seemed to say he needed weak hash-tables to implement
oject-identity, not the other way around.
Furthermore, all the systems I know of that offer something like
`object-identity' also offer weak hash-tables. Ah... maybe Java
uses object-identity to implement some of its hash-table libraries,
thus justifying the work done on object-identity?
Still if that's the only use, it seems stupid to work on object-identity
rather than just provide the has-table functionality directly.
> If implementing an identity function like the one the OP requests results
> in every object being larger (due to a design like the one I described),
There are various tricks possible to pay only for objects on which
object-identity was called. It makes `object-identity' slower, of course.
> it's likely that this overhead will be much greater than the memory leak in
> his application.
If the application is long running a 50% overhead can still be
significantly better than a memory leak.
Stefan
- Re: Object identity, (continued)
Re: Object identity, Barry Margolin, 2003/10/21
Re: Object identity, Lars Brinkhoff, 2003/10/21
Message not available