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
b54f4dea
Kaydet (Commit)
b54f4dea
authored
Kas 06, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added 'Introduction' section head and 'Memory Management' subsection.
üst
8dbcdd0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
extref.tex
Doc/extref.tex
+20
-1
No files found.
Doc/extref.tex
Dosyayı görüntüle @
b54f4dea
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
\chapter
{
Extension Reference
}
\chapter
{
Extension Reference
}
\section
{
Introduction
}
From the viewpoint of of C access to Python services, we have:
From the viewpoint of of C access to Python services, we have:
\begin{enumerate}
\begin{enumerate}
...
@@ -13,7 +15,7 @@ From the viewpoint of of C access to Python services, we have:
...
@@ -13,7 +15,7 @@ From the viewpoint of of C access to Python services, we have:
to write a simple application that gets Python code from the user,
to write a simple application that gets Python code from the user,
execs it, and returns the output or errors.
execs it, and returns the output or errors.
\item
"Abstract objects layer": which is the subject of this
proposal
.
\item
"Abstract objects layer": which is the subject of this
chapter
.
It has many functions operating on objects, and lest you do many
It has many functions operating on objects, and lest you do many
things from C that you can also write in Python, without going
things from C that you can also write in Python, without going
through the Python parser.
through the Python parser.
...
@@ -46,6 +48,23 @@ From the viewpoint of of C access to Python services, we have:
...
@@ -46,6 +48,23 @@ From the viewpoint of of C access to Python services, we have:
so new objects can be returned from C functions that otherwise treat
so new objects can be returned from C functions that otherwise treat
objects generically.
objects generically.
\subsection
{
Memory Management
}
For all of the functions described in this chapter, if a function
retains a reference to a Python object passed as an argument, then the
function will increase the reference count of the object. It is
unnecessary for the caller to increase the reference count of an
argument in anticipation of the object's retention.
All Python objects returned from functions should be treated as new
objects. Functions that return objects assume that the caller will
retain a reference and the reference count of the object has already
been incremented to account for this fact. A caller that does not
retain a reference to an object that is returned from a function
must decrement the reference count of the object (using
DECREF(object)) to prevent memory leaks.
\section
{
Object Protocol
}
\section
{
Object Protocol
}
\begin{cfuncdesc}
{
int
}{
PyObject
_
Print
}{
PyObject *o, FILE *fp, int flags
}
\begin{cfuncdesc}
{
int
}{
PyObject
_
Print
}{
PyObject *o, FILE *fp, int flags
}
...
...
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