diff options
author | Christopher Ferris <cferris@google.com> | 2017-08-11 02:04:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-08-11 02:04:47 +0000 |
commit | 30438e4cea83628bcacbedff37a35398bb8b40e7 (patch) | |
tree | d0dab96c8f737ae4058b1e144ced6418823b5b77 /benchmarks/util.cpp | |
parent | 73c3be22199a42bed53245b9b648e276de0b6422 (diff) | |
parent | a98a5fb63ee00bbd7f1663192453efcdf117cb92 (diff) |
Merge "Improve error handling and fix minor bugs in bionic benchmarks."
Diffstat (limited to 'benchmarks/util.cpp')
-rw-r--r-- | benchmarks/util.cpp | 7 |
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) { |