Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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ç
Batuhan Osman TASKAYA
cpython
Commits
ca7b0464
Kaydet (Commit)
ca7b0464
authored
Şub 04, 2014
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17162: Add PyType_GetSlot.
üst
83bdfa08
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
2 deletions
+30
-2
type.rst
Doc/c-api/type.rst
+10
-0
object.h
Include/object.h
+3
-0
NEWS
Misc/NEWS
+2
-0
xxlimited.c
Modules/xxlimited.c
+1
-1
typeobject.c
Objects/typeobject.c
+13
-0
setup.py
setup.py
+1
-1
No files found.
Doc/c-api/type.rst
Dosyayı görüntüle @
ca7b0464
...
@@ -97,3 +97,13 @@ Type Objects
...
@@ -97,3 +97,13 @@ Type Objects
types. This allows the caller to reference other heap types as base types.
types. This allows the caller to reference other heap types as base types.
.. versionadded:: 3.3
.. versionadded:: 3.3
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
Return the function pointer stored int the given slot. If the
result is *NULL*, this indicates that either the slot is *NULL*,
or that the function was called with invalid parameters.
Callers will typically cast the result pointer into the appropriate
function type.
.. versionadded:: 3.4
Include/object.h
Dosyayı görüntüle @
ca7b0464
...
@@ -439,6 +439,9 @@ PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
...
@@ -439,6 +439,9 @@ PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC
(
PyObject
*
)
PyType_FromSpecWithBases
(
PyType_Spec
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyType_FromSpecWithBases
(
PyType_Spec
*
,
PyObject
*
);
#endif
#endif
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
PyAPI_FUNC
(
void
*
)
PyType_GetSlot
(
PyTypeObject
*
,
int
);
#endif
#ifndef Py_LIMITED_API
#ifndef Py_LIMITED_API
/* The *real* layout of a type object when allocated on the heap */
/* The *real* layout of a type object when allocated on the heap */
...
...
Misc/NEWS
Dosyayı görüntüle @
ca7b0464
...
@@ -10,6 +10,8 @@ Release date: 2014-02-09
...
@@ -10,6 +10,8 @@ Release date: 2014-02-09
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #17162: Add PyType_GetSlot.
- Issue #20162: Fix an alignment issue in the siphash24() hash function which
- Issue #20162: Fix an alignment issue in the siphash24() hash function which
caused a crash on PowerPC 64-bit (ppc64).
caused a crash on PowerPC 64-bit (ppc64).
...
...
Modules/xxlimited.c
Dosyayı görüntüle @
ca7b0464
...
@@ -44,7 +44,7 @@ static void
...
@@ -44,7 +44,7 @@ static void
Xxo_dealloc
(
XxoObject
*
self
)
Xxo_dealloc
(
XxoObject
*
self
)
{
{
Py_XDECREF
(
self
->
x_attr
);
Py_XDECREF
(
self
->
x_attr
);
PyObject_Del
(
self
);
((
freefunc
)
PyType_GetSlot
(
Py_TYPE
(
self
),
Py_tp_free
))
(
self
);
}
}
static
PyObject
*
static
PyObject
*
...
...
Objects/typeobject.c
Dosyayı görüntüle @
ca7b0464
...
@@ -2641,6 +2641,19 @@ PyType_FromSpec(PyType_Spec *spec)
...
@@ -2641,6 +2641,19 @@ PyType_FromSpec(PyType_Spec *spec)
return
PyType_FromSpecWithBases
(
spec
,
NULL
);
return
PyType_FromSpecWithBases
(
spec
,
NULL
);
}
}
void
*
PyType_GetSlot
(
PyTypeObject
*
type
,
int
slot
)
{
if
(
!
PyType_HasFeature
(
type
,
Py_TPFLAGS_HEAPTYPE
))
{
PyErr_BadInternalCall
();
return
NULL
;
}
if
(
slot
>=
Py_ARRAY_LENGTH
(
slotoffsets
))
{
/* Extension module requesting slot from a future version */
return
NULL
;
}
return
*
(
void
**
)(((
char
*
)
type
)
+
slotoffsets
[
slot
]);
}
/* Internal API to look for a name through the MRO.
/* Internal API to look for a name through the MRO.
This returns a borrowed reference, and doesn't set an exception! */
This returns a borrowed reference, and doesn't set an exception! */
...
...
setup.py
Dosyayı görüntüle @
ca7b0464
...
@@ -1539,7 +1539,7 @@ class PyBuildExt(build_ext):
...
@@ -1539,7 +1539,7 @@ class PyBuildExt(build_ext):
if
'd'
not
in
sys
.
abiflags
:
if
'd'
not
in
sys
.
abiflags
:
ext
=
Extension
(
'xxlimited'
,
[
'xxlimited.c'
],
ext
=
Extension
(
'xxlimited'
,
[
'xxlimited.c'
],
define_macros
=
[(
'Py_LIMITED_API'
,
1
)])
define_macros
=
[(
'Py_LIMITED_API'
,
'0x03040000'
)])
self
.
extensions
.
append
(
ext
)
self
.
extensions
.
append
(
ext
)
return
missing
return
missing
...
...
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