Questions about IdImpl.java
"Stefan Richthofer" <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <trinity-9d87238b-d9a9-4166-83b2-5f7ed9df9747-1413979921879@3capp-gmx-bs37> |
Hello, I noticed that the result of Py.id() changes if an object was resurrected via its finalizer. I think Py.id() should provide the same value for any specific object, even if resurrection occurs (and does so on CPython <- yes, not Py.id of course, but the equivalent builtin function.). This hinders some gc-related debugging and should be fixed anyway. To do this I looked into IdImpl.java, where the ids are generated. To fix this properly I have two questions: IdImpl builds a weak hashmap to map PyObjects or java objects to ids. 1) Why does it use the hash of java-proxy if available and the hash of PyObject only as a fallback? 2) Is it possible for two or more PyObjects to have the same java-proxy object? In this case IdImpl would provide the same id for all these PyObjects. Is this intended? I can hardly belive it, since the id shall be unique per PyObject instance, shouldn't it? 3) Is it really necessary that IdImpl can also provide unique ids for ordinary java objects? Would it be okay to support only PyObjects? (since Py.id() only accepts PyObjects anyway) Thanks in advance! Stefan ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-dev