Skip to content

Commit 8b4b477

Browse files
authored
Stop using SET_TRUELENGTH(), SETLENGTH(), SET_GROWABLE_BIT() (#1593)
* Stop using SET_TRUELENGTH(), SETLENGTH(), SET_GROWABLE_BIT() Removes this NOTE: File 'readr/libs/readr.so': Found non-API calls to R: ‘SETLENGTH’, ‘SET_GROWABLE_BIT’, ‘SET_TRUELENGTH’ Compiled code should not call non-API entry points in R. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual, and section ‘Moving into C API compliance’ for issues with the use of non-API entry points. * Quick benchmark study * Add NEWS bullet * Remove benchmark study
1 parent 8b11785 commit 8b4b477

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
^pkgdown$
3030
^rcon$
3131
^inst/rcon$
32+
^inst/bench$
3233
^azure-pipelines\.yml$
3334
^LICENSE\.md$
3435
^\.github/workflows/R-CMD-check\.yaml$

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
* Help files below `man/` have been re-generated, as part of the effort to
99
support HTML reference manuals on CRAN.
1010

11+
* readr no longer uses `SETLENGTH()`, `SET_TRUELENGTH()`, or
12+
`SET_GROWABLE_BIT()`. This change improves C API compliance, with a small
13+
performance cost affecting only the legacy first edition parser.
14+
1115
# readr 2.1.5
1216

1317
* No major user-facing changes. Patch release with housekeeping changes and

src/Collector.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,7 @@ class Collector {
4848
if (column_ == R_NilValue)
4949
return;
5050

51-
#if R_VERSION >= R_Version(3, 4, 0)
52-
if (n > 0 && n < n_) {
53-
SET_TRUELENGTH(column_, n_);
54-
SETLENGTH(column_, n);
55-
SET_GROWABLE_BIT(column_);
56-
} else {
57-
column_ = Rf_lengthgets(column_, n);
58-
}
59-
#else
6051
column_ = Rf_lengthgets(column_, n);
61-
#endif
6252

6353
n_ = n;
6454
}

0 commit comments

Comments
 (0)