summaryrefslogtreecommitdiff
path: root/benchmarks/util.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-08-11 02:04:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-08-11 02:04:47 +0000
commit30438e4cea83628bcacbedff37a35398bb8b40e7 (patch)
treed0dab96c8f737ae4058b1e144ced6418823b5b77 /benchmarks/util.cpp
parent73c3be22199a42bed53245b9b648e276de0b6422 (diff)
parenta98a5fb63ee00bbd7f1663192453efcdf117cb92 (diff)
Merge "Improve error handling and fix minor bugs in bionic benchmarks."
Diffstat (limited to 'benchmarks/util.cpp')
-rw-r--r--benchmarks/util.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/benchmarks/util.cpp b/benchmarks/util.cpp
index 0c7254c14..92e82439f 100644
--- a/benchmarks/util.cpp
+++ b/benchmarks/util.cpp
@@ -16,6 +16,7 @@
#include "util.h"
+#include <err.h>
#include <math.h>
#include <sched.h>
#include <stdio.h>
@@ -27,12 +28,10 @@
// This function returns a pointer less than 2 * alignment + or_mask bytes into the array.
char* GetAlignedMemory(char* orig_ptr, size_t alignment, size_t or_mask) {
if ((alignment & (alignment - 1)) != 0) {
- fprintf(stderr, "warning: alignment passed into GetAlignedMemory is not a power of two.\n");
- std::abort();
+ errx(1, "warning: alignment passed into GetAlignedMemory is not a power of two.");
}
if (or_mask > alignment) {
- fprintf(stderr, "warning: or_mask passed into GetAlignedMemory is too high.\n");
- std::abort();
+ errx(1, "warning: or_mask passed into GetAlignedMemory is too high.");
}
uintptr_t ptr = reinterpret_cast<uintptr_t>(orig_ptr);
if (alignment > 0) {