Skip to content

Commit a680677

Browse files
committed
test
1 parent e2eedbc commit a680677

File tree

8 files changed

+7
-22
lines changed

8 files changed

+7
-22
lines changed

Include/internal/pycore_pymem.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ extern "C" {
1111
# error "this header requires Py_BUILD_CORE define"
1212
#endif
1313

14-
#if defined(Py_DEBUG) && defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__)
15-
# include <linux/prctl.h>
16-
# include <sys/prctl.h>
17-
#endif
18-
1914
// Try to get the allocators name set by _PyMem_SetupAllocators().
2015
// Return NULL if unknown.
2116
// Export for '_testinternalcapi' shared extension.
@@ -96,19 +91,6 @@ static inline int _PyMem_IsULongFreed(unsigned long value)
9691
#endif
9792
}
9893

99-
static inline int
100-
_PyAnnotateMemoryMap(void *addr, size_t size, const char *name)
101-
{
102-
#if defined(Py_DEBUG) && defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__)
103-
assert(strlen(name) < 80);
104-
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)addr, size, name);
105-
// Ignore errno from prctl
106-
// See: https://bugzilla.redhat.com/show_bug.cgi?id=2302746
107-
errno = 0;
108-
#endif
109-
return 0;
110-
}
111-
11294
extern int _PyMem_GetAllocatorName(
11395
const char *name,
11496
PyMemAllocatorName *allocator);

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ PYTHON_HEADERS= \
13781378
$(srcdir)/Include/internal/pycore_long.h \
13791379
$(srcdir)/Include/internal/pycore_memoryobject.h \
13801380
$(srcdir)/Include/internal/pycore_mimalloc.h \
1381+
$(srcdir)/Include/internal/pycore_mmap.h \
13811382
$(srcdir)/Include/internal/pycore_modsupport.h \
13821383
$(srcdir)/Include/internal/pycore_moduleobject.h \
13831384
$(srcdir)/Include/internal/pycore_namespace.h \

Modules/_ctypes/malloc_closure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# endif
1515
#endif
1616
#include "ctypes.h"
17-
#include "pycore_obmalloc.h" // _PyAnnotateMemoryMap()
17+
#include "pycore_mmap.h" // _PyAnnotateMemoryMap()
1818

1919
/* BLOCKSIZE can be adjusted. Larger blocksize will take a larger memory
2020
overhead, but allocate less blocks from the system. It may be that some

Modules/mmapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
2727
#include "pycore_bytesobject.h" // _PyBytes_Find()
2828
#include "pycore_fileutils.h" // _Py_stat_struct
29-
#include "pycore_pymem.h" // _PyAnnotateMemoryMap()
29+
#include "pycore_mmap.h" // _PyAnnotateMemoryMap()
3030
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
3131

3232
#include <stddef.h> // offsetof()

Objects/obmalloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "Python.h"
44
#include "pycore_interp.h" // _PyInterpreterState_HasFeature
5+
#include "pycore_mmap.h" // _PyAnnotateMemoryMap()
56
#include "pycore_object.h" // _PyDebugAllocatorStats() definition
67
#include "pycore_obmalloc.h"
78
#include "pycore_obmalloc_init.h"

Python/jit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "pycore_intrinsics.h"
1717
#include "pycore_list.h"
1818
#include "pycore_long.h"
19+
#include "pycore_mmap.h"
1920
#include "pycore_opcode_metadata.h"
2021
#include "pycore_opcode_utils.h"
2122
#include "pycore_optimizer.h"

Python/perf_jit_trampoline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#include "pycore_ceval.h" // _PyPerf_Callbacks
6262
#include "pycore_frame.h"
6363
#include "pycore_interp.h"
64-
#include "pycore_pymem.h" // _PyAnnotateMemoryMap()
64+
#include "pycore_mmap.h" // _PyAnnotateMemoryMap()
6565
#include "pycore_runtime.h" // _PyRuntime
6666

6767
#ifdef PY_HAVE_PERF_TRAMPOLINE

Python/perf_trampoline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ any DWARF information available for them).
132132
#include "Python.h"
133133
#include "pycore_ceval.h" // _PyPerf_Callbacks
134134
#include "pycore_interpframe.h" // _PyFrame_GetCode()
135-
#include "pycore_pymem.h" // _PyAnnotateMemoryMap()
135+
#include "pycore_mmap.h" // _PyAnnotateMemoryMap()
136136
#include "pycore_runtime.h" // _PyRuntime
137137

138138

0 commit comments

Comments
 (0)