FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Add `prot` argument to `external_pointer()` constructor by krlmlr · Pull Request #420 · r-lib/cpp11 · GitHub

/ cpp11 Public
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .hpp  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 3 additions & 2 deletions inst/include/cpp11/external_pointer.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ class external_pointer {

external_pointer(SEXP data) : data_(valid_type(data)) {}

external_pointer(pointer p, bool use_deleter = true, bool finalize_on_exit = true)
: data_(safe[R_MakeExternalPtr]((void*)p, R_NilValue, R_NilValue)) {
external_pointer(pointer p, bool use_deleter = true, bool finalize_on_exit = true,
SEXP prot = R_NilValue)
: data_(safe[R_MakeExternalPtr]((void*)p, R_NilValue, prot)) {
if (use_deleter) {
R_RegisterCFinalizerEx(data_, r_deleter, static_cast<r_bool>(finalize_on_exit));
}
Expand Down

Back | FazBrowse Home | New Git URL