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
c6632e7e
Kaydet (Commit)
c6632e7e
authored
Tem 07, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18203: Replace malloc() with PyMem_Malloc() to allocate arena objects
üst
80aa565f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
pyarena.c
Python/pyarena.c
+6
-6
No files found.
Python/pyarena.c
Dosyayı görüntüle @
c6632e7e
...
...
@@ -77,7 +77,7 @@ block_new(size_t size)
{
/* Allocate header and block as one unit.
ab_mem points just past header. */
block
*
b
=
(
block
*
)
m
alloc
(
sizeof
(
block
)
+
size
);
block
*
b
=
(
block
*
)
PyMem_M
alloc
(
sizeof
(
block
)
+
size
);
if
(
!
b
)
return
NULL
;
b
->
ab_size
=
size
;
...
...
@@ -92,7 +92,7 @@ static void
block_free
(
block
*
b
)
{
while
(
b
)
{
block
*
next
=
b
->
ab_next
;
f
ree
(
b
);
PyMem_F
ree
(
b
);
b
=
next
;
}
}
...
...
@@ -127,20 +127,20 @@ block_alloc(block *b, size_t size)
PyArena
*
PyArena_New
()
{
PyArena
*
arena
=
(
PyArena
*
)
m
alloc
(
sizeof
(
PyArena
));
PyArena
*
arena
=
(
PyArena
*
)
PyMem_M
alloc
(
sizeof
(
PyArena
));
if
(
!
arena
)
return
(
PyArena
*
)
PyErr_NoMemory
();
arena
->
a_head
=
block_new
(
DEFAULT_BLOCK_SIZE
);
arena
->
a_cur
=
arena
->
a_head
;
if
(
!
arena
->
a_head
)
{
f
ree
((
void
*
)
arena
);
PyMem_F
ree
((
void
*
)
arena
);
return
(
PyArena
*
)
PyErr_NoMemory
();
}
arena
->
a_objects
=
PyList_New
(
0
);
if
(
!
arena
->
a_objects
)
{
block_free
(
arena
->
a_head
);
f
ree
((
void
*
)
arena
);
PyMem_F
ree
((
void
*
)
arena
);
return
(
PyArena
*
)
PyErr_NoMemory
();
}
#if defined(Py_DEBUG)
...
...
@@ -173,7 +173,7 @@ PyArena_Free(PyArena *arena)
*/
Py_DECREF
(
arena
->
a_objects
);
f
ree
(
arena
);
PyMem_F
ree
(
arena
);
}
void
*
...
...
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