Weak references. B.B; Keinfarbton

Tom S h3r3tic at remove.mat.uni.torun.pl
Wed Apr 23 16:17:39 PDT 2008


Bjoern wrote:
> Bill Baxter schrieb:
>> of weak refs.  In addition to null pointers polluting the table, 
>> there's also just the basic overhead of needing to create an extra 
>> object for each entry.  Ideally there would be WeakArray, WeakSet, 
>> WeakHeap... etc.  I think I've seen such things in some language.  
>> Python maybe?
>>
>> --bb
> 
> weakHashMap, weakTreeMap ???
> 
> implemented in Java.... ? OpenJDK/ GNU Classpath
> Well, Frank is looking for a D weakHashMap implementation. Due to the 
> fact that I am actually doing plombering, plastering, electric, 
> establish tons of cement concrete  ... I am not able to offer a 
> solution. (Beeing allready happy that I am  able to write a msg)
> 
> Nevertheless I did like to suggest to use Bill B's weakRef!  as  inner 
> adaptor class of WeakHashMap.  (pretty much the same as in GNU 
> classpath)  as static array of WeakRef objects. Further the dCollection 
> : see dSource / collection classes are <IMO> fitting better than Tango 
> Collection.

Using the wrappers might have too much overhead. But perhaps MinTL with 
an allocator using malloc would do the trick?


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d mailing list