That could allow us to understand why commit of from space sometimes fails.
Another option would be start a separate structure with OS-related info, but
as it's a single field, let's put it into HeapStats, at least for now.
Review URL: http://codereview.chromium.org/
3118013
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5261
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
heap_stats.objects_per_type = objects_per_type;
int size_per_type[LAST_TYPE + 1] = {0};
heap_stats.size_per_type = size_per_type;
+ int os_error;
+ heap_stats.os_error = &os_error;
int end_marker;
heap_stats.end_marker = &end_marker;
i::Heap::RecordStats(&heap_stats, take_snapshot);
*stats->memory_allocator_size = MemoryAllocator::Size();
*stats->memory_allocator_capacity =
MemoryAllocator::Size() + MemoryAllocator::Available();
+ *stats->os_error = OS::GetLastError();
if (take_snapshot) {
HeapIterator iterator;
for (HeapObject* obj = iterator.next();
int* memory_allocator_capacity; // 20
int* objects_per_type; // 21
int* size_per_type; // 22
- int* end_marker; // 23
+ int* os_error; // 23
+ int* end_marker; // 24
};
}
+int OS::GetLastError() {
+ UNIMPLEMENTED();
+ return 0;
+}
+
+
// Returns the local time offset in milliseconds east of UTC without
// taking daylight savings time into account.
double OS::LocalTimeOffset() {
}
+int OS::GetLastError() {
+ return errno;
+}
+
+
// ----------------------------------------------------------------------------
// POSIX stdio support.
//
}
+int OS::GetLastError() {
+ return ::GetLastError();
+}
+
+
// ----------------------------------------------------------------------------
// Win32 console output.
//
// Returns the daylight savings offset for the given time.
static double DaylightSavingsOffset(double time);
+ // Returns last OS error.
+ static int GetLastError();
+
static FILE* FOpen(const char* path, const char* mode);
// Log file open mode is platform-dependent due to line ends issues.