Hi all,
I'm trying to track when a variable becomes invalid.
Consider the following code where the variable goes out of scope -
function SomeFunction() {
for(let i = 0; i < 10; ++i) {
let instance = new MyClass(); // MyClass is implemented in C++
}
// instance goes out of scope and isn't accessible at this line
}
Or when a variable gets reassigned.
function SomeFunction() {
let instance = new MyClass(); // MyClass is implemented in C++
instance = 10; // instance gets reassigned
}
Does v8 provide any callbacks that I can register on the object returned by
*MyClass* which gets called in the above two scenarios?
The motivation behind my ask is that, When an instance of *MyClass* is
created, some system resources (such as database connections etc) are
allocated and bound to the instance. I wish to claim them back as soon as
we can detect that the variable's value is unusable, as described in the
above two scenarios.
Thanks,
--Gautham
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/v8-users/ba5cca46-64d2-4dce-a858-6251aaa5b85a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.