OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 463 } |
464 | 464 |
465 line_start = position; | 465 line_start = position; |
466 } | 466 } |
467 close(fd); | 467 close(fd); |
468 return memory_use; | 468 return memory_use; |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 intptr_t ShortLivingIsolate() { | 472 intptr_t ShortLivingIsolate() { |
473 v8::Isolate* isolate = v8::Isolate::New(); | 473 v8::Isolate::CreateParams create_params; |
| 474 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
| 475 v8::Isolate* isolate = v8::Isolate::New(create_params); |
474 { v8::Isolate::Scope isolate_scope(isolate); | 476 { v8::Isolate::Scope isolate_scope(isolate); |
475 v8::Locker lock(isolate); | 477 v8::Locker lock(isolate); |
476 v8::HandleScope handle_scope(isolate); | 478 v8::HandleScope handle_scope(isolate); |
477 v8::Local<v8::Context> context = v8::Context::New(isolate); | 479 v8::Local<v8::Context> context = v8::Context::New(isolate); |
478 CHECK(!context.IsEmpty()); | 480 CHECK(!context.IsEmpty()); |
479 } | 481 } |
480 isolate->Dispose(); | 482 isolate->Dispose(); |
481 return MemoryInUse(); | 483 return MemoryInUse(); |
482 } | 484 } |
483 | 485 |
484 | 486 |
485 TEST(RegressJoinThreadsOnIsolateDeinit) { | 487 TEST(RegressJoinThreadsOnIsolateDeinit) { |
486 intptr_t size_limit = ShortLivingIsolate() * 2; | 488 intptr_t size_limit = ShortLivingIsolate() * 2; |
487 for (int i = 0; i < 10; i++) { | 489 for (int i = 0; i < 10; i++) { |
488 CHECK_GT(size_limit, ShortLivingIsolate()); | 490 CHECK_GT(size_limit, ShortLivingIsolate()); |
489 } | 491 } |
490 } | 492 } |
491 | 493 |
492 #endif // __linux__ and !USE_SIMULATOR | 494 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |