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
1328b52c
Kaydet (Commit)
1328b52c
authored
Nis 22, 2004
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Two new public API functions, Py_IncRef and Py_DecRef. Useful for
dynamic embedders of Python.
üst
1a9d32b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
0 deletions
+28
-0
refcounting.tex
Doc/api/refcounting.tex
+5
-0
object.h
Include/object.h
+7
-0
NEWS
Misc/NEWS
+4
-0
object.c
Objects/object.c
+12
-0
No files found.
Doc/api/refcounting.tex
Dosyayı görüntüle @
1328b52c
...
...
@@ -42,6 +42,11 @@ of Python objects.
applies.
\end{cfuncdesc}
The following functions are for runtime dynamic embedding of Python:
\cfunction
{
Py
_
IncRef(PyObject *o)
}
,
\cfunction
{
Py
_
DecRef(PyObject *o)
}
.
They are simply exported function versions of
\cfunction
{
Py
_
XINCREF()
}
and
\cfunction
{
Py
_
XDECREF()
}
, respectively.
The following functions or macros are only for use within the
interpreter core:
\cfunction
{_
Py
_
Dealloc()
}
,
\cfunction
{_
Py
_
ForgetReference()
}
,
\cfunction
{_
Py
_
NewReference()
}
, as
...
...
Include/object.h
Dosyayı görüntüle @
1328b52c
...
...
@@ -624,6 +624,13 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force);
#define Py_XINCREF(op) if ((op) == NULL) ; else Py_INCREF(op)
#define Py_XDECREF(op) if ((op) == NULL) ; else Py_DECREF(op)
/*
These are provided as conveniences to Python runtime embedders, so that
they can have object code that is not dependent on Python compilation flags.
*/
PyAPI_FUNC
(
void
)
Py_IncRef
(
PyObject
*
);
PyAPI_FUNC
(
void
)
Py_DecRef
(
PyObject
*
);
/*
_Py_NoneStruct is an object of undefined type which can be used in contexts
where NULL (nil) is not suitable (since NULL often means 'error').
...
...
Misc/NEWS
Dosyayı görüntüle @
1328b52c
...
...
@@ -471,6 +471,10 @@ Build
C
API
-----
-
New
public
functions
Py_IncRef
()
and
Py_DecRef
(),
exposing
the
functionality
of
the
Py_XINCREF
()
and
Py_XDECREF
macros
.
Useful
for
runtime
dynamic
embedding
of
Python
.
-
Added
a
new
macro
,
PySequence_Fast_ITEMS
,
which
retrieves
a
fast
sequence
's
underlying array of PyObject pointers. Useful for high speed looping.
...
...
Objects/object.c
Dosyayı görüntüle @
1328b52c
...
...
@@ -146,6 +146,18 @@ _Py_NegativeRefcount(const char *fname, int lineno, PyObject *op)
#endif
/* Py_REF_DEBUG */
void
Py_IncRef
(
PyObject
*
o
)
{
Py_XINCREF
(
o
);
}
void
Py_DecRef
(
PyObject
*
o
)
{
Py_XDECREF
(
o
);
}
PyObject
*
PyObject_Init
(
PyObject
*
op
,
PyTypeObject
*
tp
)
{
...
...
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