Am 17.11.2013 22:17, schrieb David A. Wheeler:
> 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".

Well, BALL does.  It finds many, many small expressions withing XML 
attributes when it produces wep pages.  Those little scripts are feed to 
the reader.

> And if they do, they'll just slowly increase memory use.. not hugely.

At least I would *not* bet a single cent on your "slowly" prediction here.

> 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.
>

I'm still not convinced.

So far I did not understand why does this have to be port-specific in 
the first place.  Maybe that would be the killer argument.

Maybe not: at least in my case, I'd be *happy* to have a way to 
compile-time the feature away eventually, since I know these settings 
will not change.

/Jörg

------------------------------------------------------------------------------
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

Reply via email to