search for: get_mhnd

Displaying 3 results from an estimated 3 matches for "get_mhnd".

Did you mean: get_kind
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
...p(shared_mhnd); + shared_mhnd = NULL; + } + curl_global_cleanup(); +} +static void rollback_mhnd_sentinel(void* sentinel) { + // Failed to allocate memory while registering a finalizer, + // therefore must release the object + R_ReleaseObject((SEXP)sentinel); +} +static CURLM *get_mhnd(void) +{ + if (!mhnd_sentinel) { + SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue)); + R_PreserveObject(sentinel); + UNPROTECT(1); + // Avoid leaking the sentinel before setting the finalizer + RCNTXT cntxt; + begincontext(&cntxt, CTXT_CC...
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
I'd like to raise this again now that 4.4 is out. Below is a more complete patch which includes a function to properly cleanup libcurl when R quits. Implementing this is a little tricky because libcurl is a separate "module" in R, perhaps there is a better way, but this works: view: https://github.com/r-devel/r-svn/pull/166/files patch:
2024 Sep 02
1
Big speedup in install.packages() by re-using connections
...> + } > + curl_global_cleanup(); > +} > +static void rollback_mhnd_sentinel(void* sentinel) { > + // Failed to allocate memory while registering a finalizer, > + // therefore must release the object > + R_ReleaseObject((SEXP)sentinel); > +} > +static CURLM *get_mhnd(void) > +{ > + if (!mhnd_sentinel) { > + SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue)); > + R_PreserveObject(sentinel); > + UNPROTECT(1); > + // Avoid leaking the sentinel before setting the finalizer > + RCNTXT cntxt; >...