summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-02-01 22:58:14 +0100
committerNicholas Clark <nick@ccl4.org>2012-02-01 23:00:35 +0100
commit013abb9bfbbb8091fa79597e81e7208ef1fe2dde (patch)
tree359b48c4c3a6a2e6c483ba01d140da992178e14a /sv.c
parent41be41dcb96aebc63332a6c266d9cea93c5004d4 (diff)
downloadperl-013abb9bfbbb8091fa79597e81e7208ef1fe2dde.tar.gz
Update, correct and clarify the comment in Perl_sv_setuv().
See the correspondence on ticket #36459 for more details.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 03c1874a8c..ace74bca59 100644
--- a/sv.c
+++ b/sv.c
@@ -1610,13 +1610,16 @@ Perl_sv_setuv(pTHX_ register SV *const sv, const UV u)
{
PERL_ARGS_ASSERT_SV_SETUV;
- /* With these two if statements:
+ /* With the if statement to ensure that integers are stored as IVs whenever
+ possible:
u=1.49 s=0.52 cu=72.49 cs=10.64 scripts=270 tests=20865
without
u=1.35 s=0.47 cu=73.45 cs=11.43 scripts=270 tests=20865
- If you wish to remove them, please benchmark to see what the effect is
+ If you wish to remove the following if statement, so that this routine
+ (and its callers) always return UVs, please benchmark to see what the
+ effect is. Modern CPUs may be different. Or may not :-)
*/
if (u <= (UV)IV_MAX) {
sv_setiv(sv, (IV)u);