MESSIEURS
Je m'xcuse de vous avoir dérangé pae mes accés au groupe juste par
coincidence que je mùe suis trouvé voila que je me suis désinscrit .
Je vous souhaite bonne et heureuse chance et j'espére récupérer mon PC
qui ne veux plus démarrer sous aucune forme mode sans échec ou autre
je compte sur votre aide .
       AMICALEMENT   "MOUNIR BELHADJ"

2012/4/14  <[email protected]>:
>   Today's Topic Summary
>
> Group: http://groups.google.com/group/v8-users/topics
>
> Leaking data in SetAccessor [6 Updates]
> Sample code for Isolate and/or Locker? [1 Update]
> Linking V8 statically and dynamically [1 Update]
> Make android broken? [1 Update]
>
>  Leaking data in SetAccessor
>
> Gerhans <[email protected]> Apr 13 02:57PM -0700
>
> Hi - I'm having some trouble preventing a leak of the data parameter
> passed to ObjectTemplate::SetAccessor(). I'm attempting to use a
> Persistent handle to an externally new'd pointer as the 'data'
> parameter, but the dataDeleterFn I pass to MakeWeak() never seems to
> fire. More specifically, I'm attempting to replace the Accessor on the
> fly, which of course is the only reason I would expect the data to be
> cleaned up. I've tried to force this by calling my setAccessor()
> function repeatedly (100,000+ times) and am successfully forcing V8 to
> garbage collect overall, but watching my app in Instruments it's clear
> that it's leaking memory. Does anyone have any insight into this?
>
> void setAccessor( const std::string &propName, void *data )
> {
> v8::HandleScope handleScope;
> v8::Local<External> dataExternal = v8::External::New( data );
> v8::Persistent<External> dataPersistent =
> Persistent<External>::New( dataExternal );
> dataPersistent.MakeWeak( accessor, dataDeleterFn ); // <--- never
> fires
> mInstanceTemplate->SetAccessor( v8::String::New( propName.c_str() ),
> getterFn, setterFn, dataPersistent );
> }
>
> Thanks in advance...
>
>
>
> Stephan Beal <[email protected]> Apr 14 12:00AM +0200
>
>
>> fire. More specifically, I'm attempting to replace the Accessor on the
>> fly, which of course is the only reason I would expect the data to be
>> cleaned up.
>
>
> As a partial workaround, you could clean up the previous dataPersistent on
> each call with a few minor changes. That would leak the last one set, but
> not any which have been overwritten.
>
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
>
>
> Gerhans <[email protected]> Apr 13 06:59PM -0700
>
> Thanks for the reply Stephan. You're imagining a map<string,void*> kind of
> thing? Seems workable, and I may have to resort to that, but I was hoping
> to understand the nature of the problem better. Is this my bug or V8's? I'm
> new to V8 so it seems likely I'm doing something wrong.
>
> Thanks again...
>
> On Friday, April 13, 2012 6:00:58 PM UTC-4, Stephan Beal wrote:
>
>
>
> "Charles A. Lopez" <[email protected]> Apr 14 01:35AM -0400
>
> The code is very ugly/messy.
>
> Do you have a base class? What kind of object is your data?
>
> What kind of data structure or abstract data type is this?
>
> There's a function/method called MakeWeak, so there's some kind of strength
> value involved?
>
> You have a leak? The problem might be bigger than that. Simplify. Make your
> code clearer to understand.
>
>
>
>
>
>
> Stephan Beal <[email protected]> Apr 14 10:36AM +0200
>
>
>> Thanks for the reply Stephan. You're imagining a map<string,void*> kind of
>> thing?
>
>
> Ah, i didn't consider that each _instance_ of course has its own value. i
> was thinking about saving the last one in a static.
>
>
>> Seems workable, and I may have to resort to that, but I was hoping to
>> understand the nature of the problem better. Is this my bug or V8's? I'm
>> new to V8 so it seems likely I'm doing something wrong.
>
> i don't see anything wrong with what you've done :(.
>
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
>
>
> Gerhans <[email protected]> Apr 14 05:52AM -0700
>
> @Stephan - thanks for at least confirming I'm not doing anything obviously
> wrong.
>
> @Charles - I'm sorry the code looks messy to you. I wasn't anticipating the
> Google Groups web interface introducing a hard-wrap into my post. If you
> have suggestions for improvement beyond the resulting illegible formatting
> I'd appreciate them.
>
> That said, I'm not sure how the nature of the void *data affects the
> question. If it's relevant for some reason I don't understand, it represent
> a small class encoding a pointer to member variable. The problem is that my
> "dataDeleterFn" never fires (which I have double-confirmed through
> breakpoints). I have already confirmed this is the source of my leak using
> Instruments on Mac OS X, and I've forced V8 to garbage collect so it's not
> a matter of waiting out GC.
>
> Thanks again...
>
> On Saturday, April 14, 2012 1:35:06 AM UTC-4, Charles wrote:
>
>
>
>  Sample code for Isolate and/or Locker?
>
> Luke <[email protected]> Apr 13 11:21PM -0700
>
> I'm writing an application that uses multiple threads. Each thread needs to
> have it's own separate V8 instance. I'm writing an API wrapper to access V8
> from another language. The threads are managed in this other language.
>
> Is there any simple examples on how to properly use Isolate? Is there any
> way to create an initial V8 instance with "built in" JavaScript (to compile
> - snapshot) and replicate that in the other threads.
>
> I saw this bug report which sort of shows how to use
> it: http://code.google.com/p/v8/issues/detail?id=1432 (Is this report still
> an issue?)
>
> Seems that the Isolate only lasts as long as the scope? Is that the case?
>
> This report shows that (the same code mentioned in the other report)
> lockers wasn't used
> correctly: http://code.google.com/p/v8/issues/detail?id=1433
>
> So how do I use it properly? What do I need to pass back to the threads?
> The context?
>
> Thanks!
>
> Luke
>
>
>
>  Linking V8 statically and dynamically
>
> Jakob Kummerow <[email protected]> Apr 13 10:24PM +0200
>
>>> libv8_snapshot.a
>
>>> Which do I need to link against? Which should be left out?
>
>> I still need an answer on this.
>
> Doesn't your linker figure that out all by itself when you point it to the
> right directory containing the libraries?
> If it doesn't: for a build with snapshot, you need to link against
> libv8_base.a and libv8_snapshot.a (for a build without snapshot it's
> libv8_base.a and libv8_nosnapshot.a; if you say so on the GYP (or make)
> command line then libv8_snapshot.a won't be built in the first place). The
> snapshot gives you a (small) performance benefit, especially on startup, at
> the expense of some added binary size.
>
>
>> /phpdev/lib/libv8.dylib hello_world
>
>> I'm not sure why the dylib's id is an absolute path. Perhaps this is a bug
>> in the compilation process?
>
> My understanding is that it's a flexibility vs. comfort tradeoff. Linking
> against the absolute path is easier to work with (you don't need
> LD_LIBRARY_PATH) and more robust against several versions of the libraries
> being around on your filesystem; on the other hand you lose the flexibility
> to move your libraries someplace else. Fortunately, as you've found out
> there are tools to manipulate the linkage information after the fact, so
> whatever the build system decides to do is merely a default that can be
> changed.
>
>
>
>  Make android broken?
>
> Jakob Kummerow <[email protected]> Apr 13 03:53PM +0200
>
> I finally got around to taking a look at this. Unfortunately, I have sad
> news: I see the same error you're reporting. I don't know what's causing it
> -- for some reason, the generated make target files (e.g. out/src/
> d8.target-android.mk) contain compiler flags that the compiler doesn't
> understand ("-arch i386", "-mpascal-strings" and others). These flags are
> not set in any of V8's .gyp files; they're probably due to some
> Mac-specific trickery that's built into GYP.
>
> As long as cross-compiling for Android works on Linux workstations, making
> it work on Mac too sadly doesn't have a high enough priority for me to
> spend much time on it. I'd be happy to review/land a patch, though, if you
> care enough to figure out how to fix this ;-)
>
>
>
> You received this message because you are subscribed to the Google Group
> v8-users.
> You can post via email.
> To unsubscribe from this group, send an empty message.
> For more options, visit this group.
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to