Commit b182baf3 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Return empty HeapStatistics for uninitialized isolate.

R=danno@chromium.org

Review URL: http://codereview.chromium.org/8278001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 47539761
......@@ -3961,6 +3961,15 @@ HeapStatistics::HeapStatistics(): total_heap_size_(0),
void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
if (!i::Isolate::Current()->IsInitialized()) {
// Isolate is unitialized thus heap is not configured yet.
heap_statistics->set_total_heap_size(0);
heap_statistics->set_total_heap_size_executable(0);
heap_statistics->set_used_heap_size(0);
heap_statistics->set_heap_size_limit(0);
return;
}
i::Heap* heap = i::Isolate::Current()->heap();
heap_statistics->set_total_heap_size(heap->CommittedMemory());
heap_statistics->set_total_heap_size_executable(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment