On Sun, 17 Nov 2013 15:13:09 -0500, John Cowan <co...@mercury.ccil.org> wrote: > I don't see any obvious way to do so, except with a weak-keyed hash > table mapping ports to values. Unfortunately, weak-keyed hash tables > are non-portable in the nature of things.
I know. I'm currently thinking of implementing these settings as straight-up hash tables that map from ports to values. Those are, at least, efficient to look up, even if there are many ports. Ideally they'd be weak references, but I suspect most implementations don't constantly create new ports and pass them to "readable". And if they do, they'll just slowly increase memory use.. not hugely. There is a gimmick we could use. We could create a "reset port" function that *REMOVES* the entry from the hashtable. Then, on next use, it'd recreate the entries. That would be a clean interface, but work efficiently in a portable way. That would mean that systems would need to reset ports if they create huge numbers of them. Sadly, I don't see how to deal with that cleanly without weak references. --- David A. Wheeler ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss