On 2011/09/05 07:36:42, William Hesse wrote:
On 2011/09/04 01:58:03, tfarina wrote:
> On 2011/09/03 20:00:47, Vitaly Repeshko wrote:
> > This way all the handles created in the loop will stay alive forever.
This
is
> > not something we want.
> >
> Yeah? Why they aren't destroyed with the handle_scope in the end of the
> function?
>
> So, src/d8.cc - Shell:RunShell() is wrong?
I think "forever", in this context, means as long as the while loop is
running,
which could be a long time.
In d8 it looks like this (src/d8.cc:885-891):
static const int kBufferSize = 256;
while (true) {
char buffer[kBufferSize];
printf("%s", Shell::kPrompt);
if (fgets(buffer, kBufferSize, stdin) == NULL) break;
ExecuteString(String::New(buffer), name, true, true);
}
The HandleScope is at line 867. Keeping inside the while loop is for better
garbage collection?
http://codereview.chromium.org/7828072/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev