Interestingly, the %s/Function/Object/g version worked without adding a call to
SetInternalFieldCount.
~Theodore
> On Oct 6, 2016, at 2:50 PM, Zac Hansen wrote:
>
> A guess would be that it only works on types with internal fields, which are
> only objecttemplate-sourced objects. That's the
A guess would be that it only works on types with internal fields, which
are only objecttemplate-sourced objects. That's the only thing that would
need any type of user-specified code to run on GC. But that's just a
guess. A quick glance at the source doesn't back it up.
On Thu, Oct 6, 2016 a
I don’t think the problem is allocating the handle on the heap, I’m doing that
in my code too. The significant difference between your code and my code is
that I’m using a FunctionTemplate and trying to get a weak callback on the
Functions it creates, and you’re using an ObjectTemplate. When I c
Also, here's the somewhat generalized code I use for doing this in my
integration library:
https://github.com/xaxxon/v8toolkit/blob/master/include/v8toolkit.h#L972
On Wed, Oct 5, 2016 at 8:36 PM, Zac Hansen wrote:
> Good news is, this program calls the callback. Bad news it crashes, but I
> th
Good news is, this program calls the callback. Bad news it crashes, but I
think it demonstrates the general idea.
I believe the problem with your program is that your global with the weak
callback goes away too early. In my program below you can see I'm
allocating the global on the heap (and lea
Actually, that didn't work. Any other ideas? Any techniques for debugging
GC (like getting information on where an object is referenced?)
--
--
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to th
It's in the v8::mother experimental namespace :-)
On Wednesday, October 5, 2016, wrote:
> Why didn't I think of that?
>
> Put a(mother) handle scope inside the for loop
>>
>
> Also, autocorrect failure ^
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
>
> http://groups.googl
Why didn't I think of that?
Put a(mother) handle scope inside the for loop
>
Also, autocorrect failure ^
--
--
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users"
Put a(mother) handle scope inside the for loop
On Wednesday, October 5, 2016, wrote:
> Thanks for all your feedback. I tried attaching the weak callback to the
> function instead of the callback data, and I tried a tight loop with
> AdjustAmountOfExternalAllocatedMemory. But the weak callback st
The loop is inside the handle scope if I'm reading to correctly so the
handle scope keeps a reference to everything meaning it can't be gc
On Wednesday, October 5, 2016, wrote:
> Thanks for all your feedback. I tried attaching the weak callback to the
> function instead of the callback data, and
Thanks for all your feedback. I tried attaching the weak callback to the
function instead of the callback data, and I tried a tight loop
with AdjustAmountOfExternalAllocatedMemory. But the weak callback still
isn't getting called. Here's the updated main function:
int main() {
V8::Initializ
the function template won't ever get gc'd after you've instantiated it once.
On Wed, Oct 5, 2016 at 12:56 AM Zac Hansen wrote:
> Put your inner block in a tight loop and throw in a
> http://v8.paulfryzel.com/docs/master/classv8_1_1_isolate.html#aaeda5fa60961a3d9d476c46200e30711
>
> isolate->Adju
Put your inner block in a tight loop and throw in a
http://v8.paulfryzel.com/docs/master/classv8_1_1_isolate.html#aaeda5fa60961a3d9d476c46200e30711
isolate->AdjustAmountOfExternalAllocatedMemory(100)
in there too and see what happens.
On Tue, Oct 4, 2016 at 3:48 PM, Theodore Dubois wrote:
I created the FunctionTemplate inside its own HandleScope which gets destroyed
before the program finishes, so it should get garbage collected before the end
of the program. Is that right?
~Theodore
> On Oct 4, 2016, at 3:45 PM, Zac Hansen wrote:
>
> The way I read it is that because the fun
The way I read it is that because the function template remains until the
end of the program, its data cannot be cleaned up. And since it has to
keep str around until the function template goes away, str won't be cleaned
up either because there's still a reference to it.
On Tue, Oct 4, 2016 at 2:
Interesting. So when a function template is created, its callback data will
never be freed?
~Theodore
> On Oct 4, 2016, at 1:17 AM, Jochen Eisinger wrote:
>
> v8 has an per-isolate cache of function templates. As the string is
> referenced by the function template, it will never go out of sco
v8 has an per-isolate cache of function templates. As the string is
referenced by the function template, it will never go out of scope.
I'd recommend to create a weak handle to the function you create via
GetFunction() instead
On Mon, Oct 3, 2016 at 12:27 PM Pavel Medvedev wrote:
> Hi Theodore
Hi Theodore,
In this program, weak_callback never gets called. Anyone know why?
>
>
There is no isolate->Enter() after Isolate::New(params), and no
context->Enter() after Context::New(isolate). May it be a reason?
--
--
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.co
http://v8.paulfryzel.com/docs/master/classv8_1_1_persistent_base.html#aebb8a2c97e219102f613ff3749c956f6
Specifically:
NOTE: There is no guarantee as to *when* or even *if* the callback is
> invoked. The invocation is performed solely on a best effort basis. As
> always, GC-based finalization s
19 matches
Mail list logo