Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
312f0cbb
Kaydet (Commit)
312f0cbb
authored
Tem 26, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add easy-valgrindability to built-in python
üst
0a98e622
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
Python-2.6.1-py2422.patch
python/Python-2.6.1-py2422.patch
+71
-0
makefile.mk
python/makefile.mk
+2
-1
No files found.
python/Python-2.6.1-py2422.patch
0 → 100644
Dosyayı görüntüle @
312f0cbb
http://bugs.python.org/issue2422 - adaption of the patch there to honour our G_SLICE
--- misc/Python-2.6.1/Objects/obmalloc.c 2011-07-26 13:10:12.668380720 +0100
+++ misc/build/Python-2.6.1/Objects/obmalloc.c 2011-07-26 13:17:41.951444953 +0100
@@ -1,7 +1,18 @@
#include "Python.h"
+#include <stdlib.h>
#ifdef WITH_PYMALLOC
+static int running_with_system_allocator = -1;
+
+/* If we're using GCC, use __builtin_expect() to reduce overhead of
+ the allocator checks */
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+# define UNLIKELY(value) __builtin_expect((value), 0)
+#else
+# define UNLIKELY(value) (value)
+#endif
+
/* An object allocator for Python.
Here is an introduction to the layers of the Python memory architecture,
@@ -728,6 +739,11 @@
poolp next;
uint size;
+ if (UNLIKELY(running_with_system_allocator == -1))
+ running_with_system_allocator = (getenv("G_SLICE") != NULL);
+ if (UNLIKELY(running_with_system_allocator))
+ goto redirect;
+
/*
* Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
* Most python internals blindly use a signed Py_ssize_t to track
@@ -927,6 +943,9 @@
if (p == NULL) /* free(NULL) has no effect */
return;
+ if (UNLIKELY(running_with_system_allocator > 0))
+ goto redirect;
+
pool = POOL_ADDR(p);
if (Py_ADDRESS_IN_RANGE(p, pool)) {
/* We allocated this address. */
@@ -1121,6 +1140,7 @@
return;
}
+redirect:
/* We didn't allocate this address. */
free(p);
}
@@ -1150,6 +1170,10 @@
if (nbytes > PY_SSIZE_T_MAX)
return NULL;
+ /* Treat running_with_system_allocator == -1 the same as 0 */
+ if (UNLIKELY(running_with_system_allocator > 0))
+ goto redirect;
+
pool = POOL_ADDR(p);
if (Py_ADDRESS_IN_RANGE(p, pool)) {
/* We're in charge of this block */
@@ -1177,6 +1201,7 @@
}
return bp;
}
+redirect:
/* We're not managing this block. If nbytes <=
* SMALL_REQUEST_THRESHOLD, it's tempting to try to take over this
* block. However, if we do, we need to copy the valid data from
python/makefile.mk
Dosyayı görüntüle @
312f0cbb
...
@@ -55,7 +55,8 @@ PATCH_FILES=\
...
@@ -55,7 +55,8 @@ PATCH_FILES=\
Python-aix.patch
\
Python-aix.patch
\
Python-2.6.1-urllib.patch
\
Python-2.6.1-urllib.patch
\
Python-2.6.1-sysbase.patch
\
Python-2.6.1-sysbase.patch
\
Python-2.6.1-nohardlink.patch
Python-2.6.1-nohardlink.patch
\
Python-2.6.1-py2422.patch
CONFIGURE_DIR
=
CONFIGURE_DIR
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment