Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3438c98

Browse files
committed
Use plain memset() in numeric.c, not MemSet and friends.
This essentially reverts a micro-optimization I made years ago,as part of the much larger commitd72f6c7. It's doubtfulthat there was any hard evidence for it being helpful even then,and the case is even more dubious now that modern compilersare so much smarter about inlining memset().The proximate reason for undoing it is to get rid of the type punninginherent in MemSet, for fear that that may cause problems now thatwe're applying additional optimization switches to numeric.c.At the very least this'll silence some warnings from a few oldbuildfarm animals.(It's probably past time for another look at whether MemSet is stillworth anything at all, but I do not propose to tackle that questionright now.)Discussion:https://postgr.es/m/CAJ3gD9evtA_vBo+WMYMyT-u=keHX7-r8p2w7OSRfXf42LTwCZQ@mail.gmail.com
1 parent728d4bc commit3438c98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/adt/numeric.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ static void dump_var(const char *str, NumericVar *var);
492492
pfree(buf); \
493493
} while (0)
494494

495-
#defineinit_var(v)MemSetAligned(v, 0, sizeof(NumericVar))
495+
#defineinit_var(v)memset(v, 0, sizeof(NumericVar))
496496

497497
#defineNUMERIC_DIGITS(num) (NUMERIC_HEADER_IS_SHORT(num) ? \
498498
(num)->choice.n_short.n_data : (num)->choice.n_long.n_data)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp