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

safer Function<>::operator(), Rcpp_list*(), Rcpp_lang*()#1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@romainfrancois
Copy link
Contributor

@romainfrancoisromainfrancois commentedNov 8, 2019
edited
Loading

comments in context.

*/
template<typename T1>
SEXPoperator()(const T1& t1)const {
returnRcpp_fast_eval(Rcpp_lcons(Storage::get__(),pairlist(t1)), R_GlobalEnv);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

the result ofpairlist() was not protected, andRcpp_lcons() allocates, so it might gc() it.
the result ofRcpp_lcons() is not protected, so it might be claimed whenRcpp_fast_eval() allocates ...

all changes in that file are the same.


inline SEXPRcpp_list7( SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6 )
{
Shield<SEXP>out(Rf_cons(x0,Rcpp_list6(x1, x2, x3, x4, x5, x6)) );
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Rf_cons() allocates so it might claim x0 and the result ofRcpp_list6().

Storage::set__(x) ;
}

SEXPinvoke(SEXP args_, SEXP env)const {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just a private support function to makeoperator() easier to write.

@eddelbuettel
Copy link
Member

Thanks for the PR.

Next you consider a new PR, please also consider taking another look at the fileContributing. We really prefer issue tickets before PRs. Thank you.

@romainfrancois
Copy link
ContributorAuthor

romainfrancois commentedNov 8, 2019
edited by eddelbuettel
Loading

Sure. I opened#915.

Edit by DE Removed uncalled-for tone.

@kevinushey
Copy link
Contributor

LGTM! If I understand correctly, this basically mirrors what R itself does when constructing pairlists as well.

Do you think it would be worthwhile to implement a variadic C++11 version that avoids code bloat for these as well?

@romainfrancois
Copy link
ContributorAuthor

Definitely.

@eddelbuettel
Copy link
Member

C.f.RcppCore/rcpp-logs@0e28b87

Rebased tomaster

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@romainfrancois@eddelbuettel@kevinushey

[8]ページ先頭

©2009-2025 Movatter.jp