Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: src/platform-linux.cc

Issue 47004: More compatibility changes. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
===================================================================
--- src/platform-linux.cc (revision 1565)
+++ src/platform-linux.cc (working copy)
@@ -44,7 +44,9 @@
#include <sys/stat.h> // open
#include <fcntl.h> // open
#include <unistd.h> // sysconf
+#ifdef __GLIBC__
#include <execinfo.h> // backtrace, backtrace_symbols
+#endif // def __GLIBC__
#include <strings.h> // index
#include <errno.h>
#include <stdarg.h>
@@ -361,6 +363,8 @@
int OS::StackWalk(OS::StackFrame* frames, int frames_size) {
+ // backtrace is a glibc extension.
+#ifdef __GLIBC__
void** addresses = NewArray<void*>(frames_size);
int frames_count = backtrace(addresses, frames_size);
@@ -387,6 +391,9 @@
free(symbols);
return frames_count;
+#else // ndef __GLIBC__
+ return 0;
+#endif // ndef __GLIBC__
}
@@ -814,6 +821,8 @@
static Sampler* active_sampler_ = NULL;
static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
+ // Ucontext is a glibc extension - no profiling on Android at the moment.
+#ifdef __GLIBC__
USE(info);
if (signal != SIGPROF) return;
if (active_sampler_ == NULL) return;
@@ -840,6 +849,7 @@
sample.state = Logger::state();
active_sampler_->Tick(&sample);
+#endif
}
« no previous file with comments | « src/execution.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698