Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[metadata] Use MONO_PROFILER_API on MonoClass getters in checked builds #42819

Merged
merged 1 commit into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mono/mono/metadata/class-abi-details.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
#include <mono/metadata/abi-details.h>

#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) /*nothing*/
/*
* In-tree profilers are allowed to use the offset functions. So if we're
* compiling with --enable-checked-build=private_types, mark the symbols with
* MONO_PROFILER_API
*/
#ifdef MONO_CLASS_DEF_PRIVATE
#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) intptr_t funcname (void);
#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) MONO_PROFILER_API intptr_t funcname (void);
#else
#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) static inline intptr_t funcname (void) { return MONO_STRUCT_OFFSET (argtype, fieldname); }
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/mono/mono/metadata/class-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,13 @@ union _MonoClassSizes {

/* If MonoClass definition is hidden, just declare the getters.
* Otherwise, define them as static inline functions.
*
* In-tree profilers are allowed to use the getters. So if we're compiling
* with --enable-checked-build=private_types, mark the symbols with
* MONO_PROFILER_API
*/
#ifdef MONO_CLASS_DEF_PRIVATE
#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) rettype funcname (argtype *klass);
#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) MONO_PROFILER_API rettype funcname (argtype *klass);
#else
#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) static inline rettype funcname (argtype *klass) { return optref klass-> fieldname ; }
#endif
Expand Down