Re: Memory management in features implemented in JS

2014-03-23 Thread K. Gadd
Sorry, when I say manual cycle-breaking I'm referring to cases where the cycle is kept alive by a root referencing one of the parts of the cycle. The trivial example of this would be an object with event listeners registered on it; if all the references are strong, the object's list of observers ke

Re: Memory management in features implemented in JS

2014-03-23 Thread Jason Orendorff
On 3/22/14, 7:26 AM, K. Gadd wrote: > The window and children example is intended to illustrate > that manual cycle-breaking is non-trivial; in this case it requires a > robust reference counting mechanism and code audits to ensure > reference increments/decrements are carefully matched and put in

Re: Memory management in features implemented in JS

2014-03-23 Thread Jim Blandy
On 03/23/2014 10:56 PM, Steve Fink wrote: Anyway, with your specific example, it seems to me that the problem is that you're losing information. The popups need the main window to communicate with each other, and the main window needs all of its stuff to work while it's open. The solution, then,

Re: Memory management in features implemented in JS

2014-03-23 Thread Jim Blandy
On 03/23/2014 12:17 AM, Boris Zbarsky wrote: Say we have this: observerService.addSettingObserver("data-changed", obj, "cache", null) and someone sets a "data-changed" notification. If I understand your proposal correctly, that will do some equivalent of "obj.cache = null", assuming "obj" is

Re: Memory management in features implemented in JS

2014-03-23 Thread Steve Fink
On 03/19/2014 04:39 PM, Kyle Huey wrote: > Followup to dev-platform please. > > We are discovering a lot of leaks in JS implemented DOM objects. The > general pattern seems to be that we have a DOM object that also needs > to listen to events from the message manager or notifications from the > ob

Re: Memory management in features implemented in JS

2014-03-23 Thread Steve Fink
On 03/21/2014 08:23 PM, K. Gadd wrote: > A hypothetical scenario (please ignore any minor detail errors, I'm > using this to illustrate the scenario): Let's say I have a main > document and it spawns 3 popup windows as documents. The popup windows > have references to the parent document and use th

Re: Some modules unified build is disabled in Release or Beta channel source code?

2014-03-23 Thread Ehsan Akhgari
On 2014-03-23, 3:36 PM, xunxun wrote: Hi, I found that in 28.0 and 29.0beta1 JS/src used unified build in its moz.build ( UNIFIED_SOURCES), but when I build 28.0 and 29.0beta1, I can't find JS/src modules built using unified method ( Windows+MSVC ), at the same time, dom/bindings can be bui

Some modules unified build is disabled in Release or Beta channel source code?

2014-03-23 Thread xunxun
Hi, I found that in 28.0 and 29.0beta1 JS/src used unified build in its moz.build ( UNIFIED_SOURCES), but when I build 28.0 and 29.0beta1, I can't find JS/src modules built using unified method ( Windows+MSVC ), at the same time, dom/bindings can be built using unified method. I want to k

Re: Memory management in features implemented in JS

2014-03-23 Thread Boris Zbarsky
On 3/23/14 2:55 AM, Jim Blandy wrote: I hope we're not talking past each other... the visible behavior of Services.obs.addObserver("glurph", () => { alert("Glurph!"); }, true) (pretending that the function supported nsIWeakReference) depends on when the GC notices the function is garbage. No?

Re: Memory management in features implemented in JS

2014-03-23 Thread Jim Blandy
On 03/22/2014 11:36 PM, Boris Zbarsky wrote: On 3/23/14 2:21 AM, Jim Blandy wrote: See my slightly longer explanation in the previous message. The advantage over passing true for ownsWeak is that my proposed API is completely deterministic. I'm not sure I follow The current setup in the o