summaryrefslogtreecommitdiff
path: root/absl/base/internal/unscaledcycleclock.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-09-10 12:22:01 -0700
committerGravatar dinord <dinor@google.com>2021-09-10 19:51:12 +0000
commitcfbf5bf948a2656bda7ddab59d3bcb29595c144c (patch)
treedf31f73d4e0b3d513075d8bc662661fd4b1b190c /absl/base/internal/unscaledcycleclock.h
parentc22c032a353b5dc16d86ddc879e628344e591e77 (diff)
Export of internal Abseil changes
-- 77e710b0ced5792a328e88bcb938a41484bf4cdc by Saleem Abdulrasool <abdulras@google.com>: absl: add an implementation for UnscaledCycleClock on RISCV Add an implementation for UnscaledCycleClock on RISC-V targets. PiperOrigin-RevId: 395982312 -- 84430fce6760c488ca36401cd530f44268ac710d by Martijn Vels <mvels@google.com>: Harden CordRepBtreeReader against reading up to or beyond EOF This change hardens the reader to Next() calls on EOF situations. It changes the 'consumed()' property inside CordRepBtreeReader into a 'remaining()' property which is easier to understand and use than the 'consumed()' property QED the function documentation and use in cord.cc This change also adds the CharIterator test to the CordTest fixture enabling them to be run with btree cords. PiperOrigin-RevId: 395971732 -- 6557e628f2613169da8f693189223acb30e07833 by Martijn Vels <mvels@google.com>: Add AdvanceAndRead() test addressing the edge case surfaced in b/197776822 This adds a test explicitly exercising all possible AdvanceAndRead() calls on CharIterator. As per the linked bug, a partial or full small read ending exactly at the end of the last edge of a btree cord results in an attempt to read beyond that last edge and subsequent failure. We will fix the bug and enable these tests for btree in a subsequent change. PiperOrigin-RevId: 395958317 GitOrigin-RevId: 77e710b0ced5792a328e88bcb938a41484bf4cdc Change-Id: Ie6e21ce36980515165af7cf046cf199ecbe0ddb0
Diffstat (limited to 'absl/base/internal/unscaledcycleclock.h')
-rw-r--r--absl/base/internal/unscaledcycleclock.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/base/internal/unscaledcycleclock.h b/absl/base/internal/unscaledcycleclock.h
index 82f2c87a..681ff8f9 100644
--- a/absl/base/internal/unscaledcycleclock.h
+++ b/absl/base/internal/unscaledcycleclock.h
@@ -46,8 +46,8 @@
// The following platforms have an implementation of a hardware counter.
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
- defined(__powerpc__) || defined(__ppc__) || \
- defined(_M_IX86) || defined(_M_X64)
+ defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \
+ defined(_M_IX86) || defined(_M_X64)
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0
@@ -80,8 +80,8 @@
// This macro can be used to test if UnscaledCycleClock::Frequency()
// is NominalCPUFrequency() on a particular platform.
-#if (defined(__i386__) || defined(__x86_64__) || \
- defined(_M_IX86) || defined(_M_X64))
+#if (defined(__i386__) || defined(__x86_64__) || defined(__riscv) || \
+ defined(_M_IX86) || defined(_M_X64))
#define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY
#endif