Skip to content

Commit 39a138f

Browse files
committed
Revert "Fix comments in instr_time.h and remove an unneeded cast to int64"
This reverts commit 3dcb09d. Tom Lane pointed out that it broke the abstraction provided by the macros. The callers should not need to know what the internal type is. This commit is an exact revert, the next commit will fix the comments on the macros that incorrectly claim that they return uint64. Discussion: https://www.postgresql.org/message-id/ZrHkv3MAQfwNSmTG@ip-10-97-1-34.eu-west-3.compute.internal
1 parent 6e086fa commit 39a138f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/include/portability/instr_time.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
*
3333
* INSTR_TIME_GET_MILLISEC(t) convert t to double (in milliseconds)
3434
*
35-
* INSTR_TIME_GET_MICROSEC(t) get t in microseconds
35+
* INSTR_TIME_GET_MICROSEC(t) convert t to uint64 (in microseconds)
3636
*
37-
* INSTR_TIME_GET_NANOSEC(t) get t in nanoseconds
37+
* INSTR_TIME_GET_NANOSEC(t) convert t to uint64 (in nanoseconds)
3838
*
3939
* Note that INSTR_TIME_SUBTRACT and INSTR_TIME_ACCUM_DIFF convert
4040
* absolute times to intervals. The INSTR_TIME_GET_xxx operations are
@@ -123,7 +123,7 @@ pg_clock_gettime_ns(void)
123123
((t) = pg_clock_gettime_ns())
124124

125125
#define INSTR_TIME_GET_NANOSEC(t) \
126-
((t).ticks)
126+
((int64) (t).ticks)
127127

128128

129129
#else /* WIN32 */

0 commit comments

Comments
 (0)