Question about Weak Maps

2011-04-07 Thread Mikeal Rogers
Weak Maps seems to have superseded ephemeron tables. They are non-enumerable, does this also exclude any call that gives you an array of the current keys? If this is the case then it excludes the primary use case we have in node for ephemeron tables. I can understand why you might want to

Re: Question about Weak Maps

2011-04-07 Thread Andreas Gal
Why would you want to enumerate the keys in a weak map? Andreas On Apr 7, 2011, at 4:04 PM, Mikeal Rogers wrote: Weak Maps seems to have superseded ephemeron tables. They are non-enumerable, does this also exclude any call that gives you an array of the current keys? If this is the

Re: Question about Weak Maps

2011-04-07 Thread Bradley Meck
long post a while back about the security problems w/ enumeration on weak maps if you search for it. On Thu, Apr 7, 2011 at 6:13 PM, Mikeal Rogers mikeal.rog...@gmail.com wrote: requests come in to a server, you want to stick them in a hash so that you can query the server at any time for all

Re: Question about Weak Maps

2011-04-07 Thread David Herman
[Disclaimer: I'm not an expert at server code. That said...] Don't you generally need to manage the policy for these kinds of requests manually anyway? In particular, you can't actually tell if a user has abandoned their session, since the browser doesn't let you know when that's happened. So

Re: Question about Weak Maps

2011-04-07 Thread Mark S. Miller
Hi Mikeal, I do not yet understand your server example. Perhaps a bit of illustrative code would help? In any case, within memory-safe gc languages, there are several well motivated enhancements of the API of the collector. Several of these are fundamental, in that there is no way to emulate

Re: Question about Weak Maps

2011-04-07 Thread Mark S. Miller
On Thu, Apr 7, 2011 at 9:11 PM, Mark S. Miller erig...@google.com wrote: Hi Mikeal, I do not yet understand your server example. Perhaps a bit of illustrative code would help? In any case, within memory-safe gc languages, there are several well motivated enhancements of the API of the

Re: Question about Weak Maps

2011-04-07 Thread Mark S. Miller
On Thu, Apr 7, 2011 at 9:15 PM, Mark S. Miller erig...@google.com wrote: On Thu, Apr 7, 2011 at 9:11 PM, Mark S. Miller erig...@google.com wrote: Hi Mikeal, I do not yet understand your server example. Perhaps a bit of illustrative code would help? In any case, within memory-safe gc