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
6fd92dc4
Kaydet (Commit)
6fd92dc4
authored
Mar 02, 2006
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added words about what PyArena_Malloc() does.
üst
cb9426b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
pyarena.h
Include/pyarena.h
+16
-4
pyarena.c
Python/pyarena.c
+1
-1
No files found.
Include/pyarena.h
Dosyayı görüntüle @
6fd92dc4
...
@@ -35,11 +35,23 @@ extern "C" {
...
@@ -35,11 +35,23 @@ extern "C" {
PyAPI_FUNC
(
PyArena
*
)
PyArena_New
(
void
);
PyAPI_FUNC
(
PyArena
*
)
PyArena_New
(
void
);
PyAPI_FUNC
(
void
)
PyArena_Free
(
PyArena
*
);
PyAPI_FUNC
(
void
)
PyArena_Free
(
PyArena
*
);
PyAPI_FUNC
(
void
*
)
PyArena_Malloc
(
PyArena
*
,
size_t
);
/* Mostly like malloc(), return the address of a block of memory spanning
* `size` bytes, or return NULL (without setting an exception) if enough
* new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with
* size=0 does not guarantee to return a unique pointer (the pointer
* returned may equal one or more other pointers obtained from
* PyArena_Malloc()).
* Note that pointers obtained via PyArena_Malloc() must never be passed to
* the system free() or realloc(), or to any of Python's similar memory-
* management functions. PyArena_Malloc()-obtained pointers remain valid
* until PyArena_Free(ar) is called, at which point all pointers obtained
* from the arena `ar` become invalid simultaneously.
*/
PyAPI_FUNC
(
void
*
)
PyArena_Malloc
(
PyArena
*
,
size_t
size
);
/* This routine
s
isn't a proper arena allocation routine. It takes
/* This routine isn't a proper arena allocation routine. It takes
a PyObject* and records it so that it can be DECREFed when the
*
a PyObject* and records it so that it can be DECREFed when the
arena is freed.
*
arena is freed.
*/
*/
PyAPI_FUNC
(
int
)
PyArena_AddPyObject
(
PyArena
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyArena_AddPyObject
(
PyArena
*
,
PyObject
*
);
...
...
Python/pyarena.c
Dosyayı görüntüle @
6fd92dc4
...
@@ -150,7 +150,7 @@ PyArena_Malloc(PyArena *arena, size_t size)
...
@@ -150,7 +150,7 @@ PyArena_Malloc(PyArena *arena, size_t size)
arena
->
total_blocks
++
;
arena
->
total_blocks
++
;
arena
->
total_block_size
+=
arena
->
a_cur
->
ab_size
;
arena
->
total_block_size
+=
arena
->
a_cur
->
ab_size
;
if
(
arena
->
a_cur
->
ab_size
>
DEFAULT_BLOCK_SIZE
)
if
(
arena
->
a_cur
->
ab_size
>
DEFAULT_BLOCK_SIZE
)
arena
->
total_big_blocks
++
;
++
arena
->
total_big_blocks
;
#endif
#endif
}
}
return
p
;
return
p
;
...
...
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