Skip to content

Commit

Permalink
Hide some entry point in memory.c not used on CRAN/BIOC or in current…
Browse files Browse the repository at this point in the history
… API.

git-svn-id: https://svn.r-project.org/R/trunk@86611 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
luke committed May 24, 2024
1 parent 685baa8 commit cb211c3
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 26 deletions.
42 changes: 38 additions & 4 deletions src/gnuwin32/Rdll.hide
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ALTREP_UNSERIALIZE_EX
ALTSTRING_SET_ELT
ALTVEC_EXTRACT_SUBSET
ASSIGNMENT_PENDING
BASE_SYM_CACHED
BINDING_IS_LOCKED
BM_norm_keep
Expand Down Expand Up @@ -54,19 +55,26 @@
BZ2_hbMakeCodeLengths
BZ2_indexIntoF
BZ2_rNums
CAR0
CONS_NR
CPFun
ConsoleAcceptCmd
DECREMENT_REFCNT
DISABLE_REFCNT
DebugMenuitem
DefaultPalette
ENABLE_REFCNT
ENSURE_NAMED
EhiWakeUp
EncodeEnvironment
EncodeExtptr
EncodeReal2
HASHASH
INIT_BNDCELL
IF_PROMSXP_SET_PRVALUE
INCREMENT_REFCNT
INIT_BNDCELL
IS_ACTIVE_BINDING
IS_ASSIGNMENT_CALL
IS_BYTES
IS_LATIN1
IS_SPECIAL_SYMBOL
Expand All @@ -76,15 +84,24 @@
Init_R_Variables
LOCK_BINDING
LoadInitFile
MARK
MARK_ASSIGNMENT_CALL
MAYBEJIT
MDIset
MDIsize
MISSING
MainThread
NOJIT
NO_SPECIAL_SYMBOLS
PROMISE_IS_EVALUATED
PROMISE_TAG
PrintUsage
ProfileEvent
PROMISE_IS_EVALUATED
RAISE_NAMED
REvprintf_internal
RExitContext
RSTEP
RTRACE
R_BCIntActive
R_BCNodeStackBase
R_BCProtReset
Expand Down Expand Up @@ -222,6 +239,7 @@
R_XDRDecodeInteger
R_XDREncodeDouble
R_XDREncodeInteger
R_allocObject
R_args_enable_refcnt
R_binary
R_checkConstants
Expand Down Expand Up @@ -252,12 +270,14 @@
R_dot_Group
R_dot_Methods
R_expand_binding_value
R_expand_promise_value
R_fgetc
R_findBCInterpreterSrcref
R_findExecContext
R_findParentContext
R_fixslash
R_flexiblas_info
R_gc_running
R_getBCInterpreterExpression
R_getClockIncrement
R_getCurrentSrcref
Expand Down Expand Up @@ -351,7 +371,6 @@
Rconn_getline
Rcons_vprintf
Rconsolesetwidth
Rf_applyClosure
Rf_AdobeSymbol2ucs2
Rf_BindDomain
Rf_CheckFormals
Expand Down Expand Up @@ -423,6 +442,7 @@
Rf_WarningMessage
Rf_addMissingVarsToNewEnv
Rf_allocCharsxp
Rf_applyClosure
Rf_asVecSize
Rf_bd0
Rf_chebyshev_eval
Expand Down Expand Up @@ -533,8 +553,10 @@
Rvsnprintf_mbcs
Rwin_rename
Rwin_wrename
SETTER_CLEAR_NAMED
SET_ACTIVE_BINDING_BIT
SET_ASCII
SET_ASSIGNMENT_PENDING
SET_BASE_SYM_CACHED
SET_BNDCELL
SET_BNDCELL_DVAL
Expand All @@ -544,16 +566,28 @@
SET_BYTES
SET_CACHED
SET_CXTAIL
SET_DDVAL
SET_HASHASH
SET_INTERNAL
SET_LATIN1
SET_MAYBEJIT
SET_MISSING
SET_NOJIT
SET_NO_SPECIAL_SYMBOLS
SET_PRIMOFFSET
SET_PRINTNAME
SET_PROMISE_TAG
SET_RSTEP
SET_RTRACE
SET_SPECIAL_SYMBOL
SET_SYMVALUE
SET_UTF8
Sys_TempDir
TRACKREFS
UNIMPLEMENTED_TYPEt
UNLOCK_BINDING
UNSET_BASE_SYM_CACHED
UNSET_MAYBEJIT
UNSET_NO_SPECIAL_SYMBOLS
UNSET_SPECIAL_SYMBOL
UTF8in
Expand Down Expand Up @@ -771,8 +805,8 @@
do_curlGetHeaders
do_curlVersion
do_date
do_declare
do_debug
do_declare
do_delayed
do_deparse
do_detach
Expand Down
64 changes: 42 additions & 22 deletions src/main/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static void gc_error(const char *msg)
}

/* These are used in profiling to separate out time in GC */
int R_gc_running(void) { return R_in_gc; }
attribute_hidden int R_gc_running(void) { return R_in_gc; }

#ifdef TESTING_WRITE_BARRIER
# define PROTECTCHECK
Expand Down Expand Up @@ -3849,26 +3849,34 @@ DL_FUNC R_ExternalPtrAddrFn(SEXP s)
/* General Cons Cell Attributes */
SEXP (ATTRIB)(SEXP x) { return CHK(ATTRIB(CHK(x))); }
int (OBJECT)(SEXP x) { return OBJECT(CHK(x)); }
int (MARK)(SEXP x) { return MARK(CHK(x)); }
int (TYPEOF)(SEXP x) { return TYPEOF(CHK(x)); }
int (NAMED)(SEXP x) { return NAMED(CHK(x)); }
int (RTRACE)(SEXP x) { return RTRACE(CHK(x)); }
attribute_hidden int (RTRACE)(SEXP x) { return RTRACE(CHK(x)); }
int (LEVELS)(SEXP x) { return LEVELS(CHK(x)); }
int (REFCNT)(SEXP x) { return REFCNT(CHK(x)); }
int (TRACKREFS)(SEXP x) { return TRACKREFS(CHK(x)); }
attribute_hidden int (TRACKREFS)(SEXP x) { return TRACKREFS(CHK(x)); }
int (ALTREP)(SEXP x) { return ALTREP(CHK(x)); }
int (IS_SCALAR)(SEXP x, int type) { return IS_SCALAR(CHK(x), type); }
void (MARK_NOT_MUTABLE)(SEXP x) { MARK_NOT_MUTABLE(CHK(x)); }

attribute_hidden int (MARK)(SEXP x) { return MARK(CHK(x)); }
attribute_hidden
void (DECREMENT_REFCNT)(SEXP x) { DECREMENT_REFCNT(CHK(x)); }
attribute_hidden
void (INCREMENT_REFCNT)(SEXP x) { INCREMENT_REFCNT(CHK(x)); }
attribute_hidden
void (DISABLE_REFCNT)(SEXP x) { DISABLE_REFCNT(CHK(x)); }
attribute_hidden
void (ENABLE_REFCNT)(SEXP x) { ENABLE_REFCNT(CHK(x)); }
void (MARK_NOT_MUTABLE)(SEXP x) { MARK_NOT_MUTABLE(CHK(x)); }
attribute_hidden
int (ASSIGNMENT_PENDING)(SEXP x) { return ASSIGNMENT_PENDING(CHK(x)); }
void (SET_ASSIGNMENT_PENDING)(SEXP x, int v)
attribute_hidden void (SET_ASSIGNMENT_PENDING)(SEXP x, int v)
{
SET_ASSIGNMENT_PENDING(CHK(x), v);
}
attribute_hidden
int (IS_ASSIGNMENT_CALL)(SEXP x) { return IS_ASSIGNMENT_CALL(CHK(x)); }
attribute_hidden
void (MARK_ASSIGNMENT_CALL)(SEXP x) { MARK_ASSIGNMENT_CALL(CHK(x)); }

void (SET_ATTRIB)(SEXP x, SEXP v) {
Expand All @@ -3887,6 +3895,7 @@ void (SET_NAMED)(SEXP x, int v)
SET_NAMED(CHK(x), v);
#endif
}
attribute_hidden
void (SET_RTRACE)(SEXP x, int v) { SET_RTRACE(CHK(x), v); }
int (SETLEVELS)(SEXP x, int v) { return SETLEVELS(CHK(x), v); }
void DUPLICATE_ATTRIB(SEXP to, SEXP from) {
Expand All @@ -3901,8 +3910,10 @@ void SHALLOW_DUPLICATE_ATTRIB(SEXP to, SEXP from) {
}

void (ENSURE_NAMEDMAX)(SEXP x) { ENSURE_NAMEDMAX(CHK(x)); }
void (ENSURE_NAMED)(SEXP x) { ENSURE_NAMED(CHK(x)); }
attribute_hidden void (ENSURE_NAMED)(SEXP x) { ENSURE_NAMED(CHK(x)); }
attribute_hidden
void (SETTER_CLEAR_NAMED)(SEXP x) { SETTER_CLEAR_NAMED(CHK(x)); }
attribute_hidden
void (RAISE_NAMED)(SEXP x, int n) { RAISE_NAMED(CHK(x), n); }

/* S4 object testing */
Expand All @@ -3911,11 +3922,11 @@ void (SET_S4_OBJECT)(SEXP x){ SET_S4_OBJECT(CHK(x)); }
void (UNSET_S4_OBJECT)(SEXP x){ UNSET_S4_OBJECT(CHK(x)); }

/* JIT optimization support */
int (NOJIT)(SEXP x) { return NOJIT(CHK(x)); }
int (MAYBEJIT)(SEXP x) { return MAYBEJIT(CHK(x)); }
void (SET_NOJIT)(SEXP x) { SET_NOJIT(CHK(x)); }
void (SET_MAYBEJIT)(SEXP x) { SET_MAYBEJIT(CHK(x)); }
void (UNSET_MAYBEJIT)(SEXP x) { UNSET_MAYBEJIT(CHK(x)); }
attribute_hidden int (NOJIT)(SEXP x) { return NOJIT(CHK(x)); }
attribute_hidden int (MAYBEJIT)(SEXP x) { return MAYBEJIT(CHK(x)); }
attribute_hidden void (SET_NOJIT)(SEXP x) { SET_NOJIT(CHK(x)); }
attribute_hidden void (SET_MAYBEJIT)(SEXP x) { SET_MAYBEJIT(CHK(x)); }
attribute_hidden void (UNSET_MAYBEJIT)(SEXP x) { UNSET_MAYBEJIT(CHK(x)); }

/* Growable vector support */
int (IS_GROWABLE)(SEXP x) { return IS_GROWABLE(CHK(x)); }
Expand Down Expand Up @@ -3954,9 +3965,11 @@ void (SETLENGTH)(SEXP x, R_xlen_t v)
void (SET_TRUELENGTH)(SEXP x, R_xlen_t v) { SET_TRUELENGTH(CHK2(x), v); }
int (IS_LONG_VEC)(SEXP x) { return IS_LONG_VEC(CHK2(x)); }
#ifdef TESTING_WRITE_BARRIER
attribute_hidden
R_xlen_t (STDVEC_LENGTH)(SEXP x) { return STDVEC_LENGTH(CHK2(x)); }
attribute_hidden
R_xlen_t (STDVEC_TRUELENGTH)(SEXP x) { return STDVEC_TRUELENGTH(CHK2(x)); }
void (SETALTREP)(SEXP x, int v) { SETALTREP(x, v); }
attribute_hidden void (SETALTREP)(SEXP x, int v) { SETALTREP(x, v); }
#endif

/* temporary, to ease transition away from remapping */
Expand Down Expand Up @@ -4325,7 +4338,7 @@ attribute_hidden void R_try_clear_args_refcnt(SEXP args)

/* List Accessors */
SEXP (TAG)(SEXP e) { return CHK(TAG(CHKCONS(e))); }
SEXP (CAR0)(SEXP e) { return CHK(CAR0(CHKCONS(e))); }
attribute_hidden SEXP (CAR0)(SEXP e) { return CHK(CAR0(CHKCONS(e))); }
SEXP (CDR)(SEXP e) { return CHK(CDR(CHKCONS(e))); }
SEXP (CAAR)(SEXP e) { return CHK(CAAR(CHKCONS(e))); }
SEXP (CDAR)(SEXP e) { return CHK(CDAR(CHKCONS(e))); }
Expand All @@ -4336,7 +4349,7 @@ SEXP (CADDR)(SEXP e) { return CHK(CADDR(CHKCONS(e))); }
SEXP (CADDDR)(SEXP e) { return CHK(CADDDR(CHKCONS(e))); }
SEXP (CAD4R)(SEXP e) { return CHK(CAD4R(CHKCONS(e))); }
SEXP (CAD5R)(SEXP e) { return CHK(CAD5R(CHKCONS(e))); }
int (MISSING)(SEXP x) { return MISSING(CHKCONS(x)); }
attribute_hidden int (MISSING)(SEXP x) { return MISSING(CHKCONS(x)); }

void (SET_TAG)(SEXP x, SEXP v)
{
Expand Down Expand Up @@ -4443,19 +4456,21 @@ SEXP (EXTPTR_PROT)(SEXP x) { return EXTPTR_PROT(CHK(x)); }
SEXP (EXTPTR_TAG)(SEXP x) { return EXTPTR_TAG(CHK(x)); }
void *(EXTPTR_PTR)(SEXP x) { return EXTPTR_PTR(CHK(x)); }

attribute_hidden
void (SET_MISSING)(SEXP x, int v) { SET_MISSING(CHKCONS(x), v); }

/* Closure Accessors */
SEXP (FORMALS)(SEXP x) { return CHK(FORMALS(CHK(x))); }
SEXP (BODY)(SEXP x) { return CHK(BODY(CHK(x))); }
SEXP (CLOENV)(SEXP x) { return CHK(CLOENV(CHK(x))); }
int (RDEBUG)(SEXP x) { return RDEBUG(CHK(x)); }
int (RSTEP)(SEXP x) { return RSTEP(CHK(x)); }
attribute_hidden int (RSTEP)(SEXP x) { return RSTEP(CHK(x)); }

void (SET_FORMALS)(SEXP x, SEXP v) { FIX_REFCNT(x, FORMALS(x), v); CHECK_OLD_TO_NEW(x, v); FORMALS(x) = v; }
void (SET_BODY)(SEXP x, SEXP v) { FIX_REFCNT(x, BODY(x), v); CHECK_OLD_TO_NEW(x, v); BODY(x) = v; }
void (SET_CLOENV)(SEXP x, SEXP v) { FIX_REFCNT(x, CLOENV(x), v); CHECK_OLD_TO_NEW(x, v); CLOENV(x) = v; }
void (SET_RDEBUG)(SEXP x, int v) { SET_RDEBUG(CHK(x), v); }
attribute_hidden
void (SET_RSTEP)(SEXP x, int v) { SET_RSTEP(CHK(x), v); }

/* These are only needed with the write barrier on */
Expand All @@ -4473,8 +4488,10 @@ SEXP (SYMVALUE)(SEXP x) { return CHK(SYMVALUE(CHK(x))); }
SEXP (INTERNAL)(SEXP x) { return CHK(INTERNAL(CHK(x))); }
int (DDVAL)(SEXP x) { return DDVAL(CHK(x)); }

attribute_hidden
void (SET_PRINTNAME)(SEXP x, SEXP v) { FIX_REFCNT(x, PRINTNAME(x), v); CHECK_OLD_TO_NEW(x, v); PRINTNAME(x) = v; }

attribute_hidden
void (SET_SYMVALUE)(SEXP x, SEXP v)
{
if (SYMVALUE(x) == v)
Expand All @@ -4484,8 +4501,13 @@ void (SET_SYMVALUE)(SEXP x, SEXP v)
SYMVALUE(x) = v;
}

void (SET_INTERNAL)(SEXP x, SEXP v) { FIX_REFCNT(x, INTERNAL(x), v); CHECK_OLD_TO_NEW(x, v); INTERNAL(x) = v; }
void (SET_DDVAL)(SEXP x, int v) { SET_DDVAL(CHK(x), v); }
attribute_hidden
void (SET_INTERNAL)(SEXP x, SEXP v) {
FIX_REFCNT(x, INTERNAL(x), v);
CHECK_OLD_TO_NEW(x, v);
INTERNAL(x) = v;
}
attribute_hidden void (SET_DDVAL)(SEXP x, int v) { SET_DDVAL(CHK(x), v); }

/* Environment Accessors */
SEXP (FRAME)(SEXP x) { return CHK(FRAME(CHK(x))); }
Expand Down Expand Up @@ -4783,8 +4805,7 @@ void *R_AllocStringBuffer(size_t blen, R_StringBuffer *buf)
return buf->data;
}

void
R_FreeStringBuffer(R_StringBuffer *buf)
void R_FreeStringBuffer(R_StringBuffer *buf)
{
if (buf->data != NULL) {
free(buf->data);
Expand All @@ -4793,8 +4814,7 @@ R_FreeStringBuffer(R_StringBuffer *buf)
}
}

attribute_hidden void
R_FreeStringBufferL(R_StringBuffer *buf)
void R_FreeStringBufferL(R_StringBuffer *buf)
{
if (buf->bufsize > buf->defaultSize) {
free(buf->data);
Expand Down

0 comments on commit cb211c3

Please sign in to comment.