Displaying 7 results from an estimated 7 matches for "maybe_referenced".
2017 Sep 02
1
Please avoid direct use of NAMED and SET_NAMED macros
> To allow for future changes in the way the need for duplication is
> detected in R internal C code, package C code should avoid direct
> use of NAMED,and SET_NAMED, or assumptions on the maximal value
> of NAMED. Use the macros MAYBE_REFERENCED, MAYBE_SHARED, and
> MARK_NOT_MUTABLE instead. These currently correspond to
>
> MAYBE_REFERENCED(x): NAMED(x) > 0
> MAYBE_SHARED(x): NAMED(x) > 1
> MARK_NOT_MUTABLE(x): SET_NAMED(c, NAMEDMAX)
>
> Best,
>
> luke
Checking https://cran.r-project.org/doc...
2019 Jul 30
2
Questions regarding ALTREP_SET_ELT APIs
Hi all,
I'm wondering if there is any way to define a `SET_ELT` function for an
ALTREP class? I see there are ` ALTINTEGER_SET_ELT` etc. functions exported
in Rinternal.h, but there is no corresponding ALTREP APIs to define them.
The only way to set the value of an ALTREP is through a pointer, which will
require that the ALTREP data is in memory. Is it on purpose? Will there be
any plan to
2019 Jul 30
0
[External] Questions regarding ALTREP_SET_ELT APIs
...method for ALTSTRING classes but
not yet for others. I seem to recall that there are some issues with
going there for others, but we'll probably take a closer look later
this year.
One thing to keep in mind is that the R pass-by-value semantics
require that C code duplicate an object for which MAYBE_REFERENCED is
true, and the assumption in existing code is that duplicate returns an
object that can safely be mutated. That places a lot of limitations on
what can be done. You can see some notes on the issues in the
README.md and the vignette in
https://github.com/ALTREP-examples/Rpkg-mutable.
Best,
luke...
2015 Aug 22
0
unset() function?
This wouldn't actually work at present as evaluating a promise always
sets NAMED to 2. With reference counting it would work so might be
worth considering when we switch.
Going forward it would be best to use MAYBE_REFERENCED to test whether
a duplicate is needed -- this macro is defined appropriately whether R
is compiled to use NAMED or reference counting.
Best,
luke
On Fri, 21 Aug 2015, William Dunlap wrote:
> Does R have a function like the S/S++ unset() function?
> unset(name) would remove 'name'...
2015 Aug 21
3
unset() function?
Does R have a function like the S/S++ unset() function?
unset(name) would remove 'name' from the current evaluation
frame and return its value. It allowed you to safely avoid
some memory copying when calling .C or .Call.
E.g., suppose you had C code like
#include <R.h>
#include <Rinternals.h>
SEXP add1(SEXP pX)
{
int nProtected = 0;
int n = Rf_length(pX);
2018 Apr 23
0
R 3.5.0 is released
...ler for all supported
C++ standards (e.g., -std=gnu++11 for the C++11 compiler).
Previously this was not done in a few cases where the default
standard passed the tests made (e.g. clang 6.0.0 for C++11).
C-LEVEL FACILITIES:
* 'Writing R Extensions' documents macros MAYBE_REFERENCED,
MAYBE_SHARED and MARK_NOT_MUTABLE that should be used by package
C code instead NAMED or SET_NAMED.
* The object header layout has been changed to support merging the
ALTREP branch. This requires re-installing packages that use
compiled code.
* 'Writing R Exte...
2018 Apr 23
0
R 3.5.0 is released
...ler for all supported
C++ standards (e.g., -std=gnu++11 for the C++11 compiler).
Previously this was not done in a few cases where the default
standard passed the tests made (e.g. clang 6.0.0 for C++11).
C-LEVEL FACILITIES:
* 'Writing R Extensions' documents macros MAYBE_REFERENCED,
MAYBE_SHARED and MARK_NOT_MUTABLE that should be used by package
C code instead NAMED or SET_NAMED.
* The object header layout has been changed to support merging the
ALTREP branch. This requires re-installing packages that use
compiled code.
* 'Writing R Exte...