| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #ifndef Py_INTERNAL_MMAP_H | ||
| #define Py_INTERNAL_MMAP_H | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #ifndef Py_BUILD_CORE | ||
| # error "this header requires Py_BUILD_CORE define" | ||
| #endif | ||
|
|
||
| #if defined(Py_DEBUG) && defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__) | ||
| # include <linux/prctl.h> | ||
| # include <sys/prctl.h> | ||
| #endif | ||
|
|
||
| static inline int | ||
| _PyAnnotateMemoryMap(void *addr, size_t size, const char *name) | ||
| { | ||
| #if defined(Py_DEBUG) && defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__) | ||
| assert(strlen(name) < 80); | ||
| prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)addr, size, name); | ||
| // Ignore errno from prctl | ||
| // See: https://bugzilla.redhat.com/show_bug.cgi?id=2302746 | ||
| errno = 0; | ||
| #endif | ||
| return 0; | ||
| } | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| #endif // !Py_INTERNAL_MMAP_H | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualitySurely this isn't worth putting into a macro? As a regular function, it will be fully internal, and PGO can inline the parts of it that are appropriate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI prefer static inline functions. I don't see the advantage of using a macro. Inlining or not shouldn't make any difference on performance.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.