At 14:43 18.10.2003 -0500, Michel Pelletier wrote: > > I don't like the trick of avoiding the copy if > > the refcount is one; > > AFAIK it can't be done in Jython. > >It may be possible with the java.lang.ref >package using a somewhat similar trick by (I >imagine) holding a soft reference and examining >the object's rechability to the collector. >-Michel no, if you put the last reference to an object in a weak-ref and trigger a GC (which is btw expensive), well you can discover that there was just one reference but you have also lost the object. Now if you have a tiny wrapper/contents organization you can overcome this, playing the trick with the wrapper and keeping the contents, OTOH as I said, the explicit GC is expensive, likely more than allocating and copying. regards.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4