diff options
author | Craig Tiller <ctiller@google.com> | 2015-11-21 09:00:11 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-11-21 09:00:11 -0800 |
commit | d653b394714b1fa342f0872c8262c8cde5511f4b (patch) | |
tree | 91573a209f253d58bb4a8b14d759db7e80167b3a /src/core/support | |
parent | 860f484f43841d14df61cfeda6ca5e637ed99d19 (diff) | |
parent | ceb7318d794b4174e18364f6780a5d20e6249e23 (diff) |
Merge github.com:grpc/grpc into better-profile
Diffstat (limited to 'src/core/support')
-rw-r--r-- | src/core/support/slice_buffer.c | 2 | ||||
-rw-r--r-- | src/core/support/time_win32.c | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/core/support/slice_buffer.c b/src/core/support/slice_buffer.c index 17c0b6c0f6..856d3a2439 100644 --- a/src/core/support/slice_buffer.c +++ b/src/core/support/slice_buffer.c @@ -220,7 +220,7 @@ void gpr_slice_buffer_move_first(gpr_slice_buffer *src, size_t n, return; } src_idx = 0; - for (;;) { + while (src_idx < src->capacity) { gpr_slice slice = src->slices[src_idx]; size_t slice_len = GPR_SLICE_LENGTH(slice); if (n > slice_len) { diff --git a/src/core/support/time_win32.c b/src/core/support/time_win32.c index bc0586d069..623a8d9233 100644 --- a/src/core/support/time_win32.c +++ b/src/core/support/time_win32.c @@ -66,14 +66,12 @@ gpr_timespec gpr_now(gpr_clock_type clock) { now_tv.tv_nsec = now_tb.millitm * 1000000; break; case GPR_CLOCK_MONOTONIC: + case GPR_CLOCK_PRECISE: QueryPerformanceCounter(×tamp); now_dbl = (timestamp.QuadPart - g_start_time.QuadPart) * g_time_scale; now_tv.tv_sec = (time_t)now_dbl; now_tv.tv_nsec = (int)((now_dbl - (double)now_tv.tv_sec) * 1e9); break; - case GPR_CLOCK_PRECISE: - gpr_precise_clock_now(&now_tv); - break; } return now_tv; } |