Commit 4ee6759
committed
altsxp: two fixes from the fifteenth review round
- The one-argument seq() over a length-1 opaque value asks the class for
1:x, and the class declines for an NA endpoint. Control then fell into
the "one element, so count along it" branch and answered 1L, where the
same call on an ordinary NA is an error. A numeric opaque vector now
takes the length-1 endpoint route instead; a non-numeric one still
falls through, since 1L is what base R answers for any other length-1
object. seq() never showed this because seq.default checks is.finite()
in R first -- seq.int() goes straight to do_seq.
- R_altsxp_format_common() allocated a scratch buffer per padded element
inside one vmaxget/vmaxset pair, so a whole pass held O(n * w) bytes
that were dead as soon as mkChar() had copied them out. One buffer,
sized from the widest rendering measured in the pass that already
measures the widest column: formatting 2e6 int64 values went from 84 MB
of Vcells to 53 MB, with identical output.1 parent 9bc6847 commit 4ee6759
3 files changed
Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1100 | 1103 | | |
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
1104 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1105 | 1112 | | |
1106 | 1113 | | |
1107 | 1114 | | |
1108 | 1115 | | |
1109 | 1116 | | |
1110 | 1117 | | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1111 | 1123 | | |
1112 | 1124 | | |
1113 | 1125 | | |
| |||
1116 | 1128 | | |
1117 | 1129 | | |
1118 | 1130 | | |
1119 | | - | |
1120 | | - | |
| 1131 | + | |
1121 | 1132 | | |
1122 | 1133 | | |
1123 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
998 | 998 | | |
999 | 999 | | |
1000 | 1000 | | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
1001 | 1016 | | |
1002 | 1017 | | |
1003 | 1018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2396 | 2396 | | |
2397 | 2397 | | |
2398 | 2398 | | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
2399 | 2419 | | |
2400 | 2420 | | |
2401 | 2421 | | |
| |||
0 commit comments