Subj : Re: memory leak To : lyg From : Brendan Eich Date : Thu Mar 18 2004 06:30 pm lyg wrote: > #ifdef JS_THREADSAFE > js_CleanupLocks(); > #endif > > I did not Define JS_THREADSAFE because there is one thread in my app, so > js_FinishDtoa is not be called. > > Is it possible that Balloc() is called if i don't define JS_THREADSAFE ? and > how i free the malloced mem in Bolloc() if i don't define it? Why are you asking about js_CleanupLocks? I said that js_FinishDtoa frees the bignums on jsdtoa.c's freelist. The call from JS_ShutDown to js_FinishDtoa is not #ifdef JS_THREADSAFE -- it is compiled unconditionally. Again, are you calling JS_ShutDown() or not? /be P.S. Please fix your system clock, it is set at least a day in the future. > > thanks for your help for many times! > > "Brendan Eich" wrote in message > news:40595B1E.5040604@meer.net... > >>lyg wrote: >> >>> in my app, memory leak often happened in >>>static Bigint *Balloc(int32 k) in jsdtoa.c >>> >>>It seems that the malloced memery is not freed, is this a bug or because > > I > >>>don't Call api to free it ? i suppose the problem is concerned with > > "static > >>>Bigint *freelist[Kmax+1]" in jsdtoa.c;" >> >>That's cleaned up by js_FinishDtoa, called by JS_ShutDown. You are >>calling JS_ShutDown after all other API calls, when shutting down the >>engine, aren't you? You should be. >> >>/be > > > .