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
5323173d
Kaydet (Commit)
5323173d
authored
Agu 03, 2012
tarafından
Jesus Cea
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #15514: Correct __sizeof__ support for cpu_set
üst
077ef45a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
test_posix.py
Lib/test/test_posix.py
+6
-0
NEWS
Misc/NEWS
+3
-0
posixmodule.c
Modules/posixmodule.c
+15
-0
No files found.
Lib/test/test_posix.py
Dosyayı görüntüle @
5323173d
...
...
@@ -1008,6 +1008,12 @@ class PosixTester(unittest.TestCase):
self
.
assertIs
(
b
,
l
)
self
.
assertEqual
(
l
.
count
(),
3
)
@requires_sched_affinity
@support.cpython_only
def
test_cpu_set_sizeof
(
self
):
self
.
assertGreater
(
sys
.
getsizeof
(
posix
.
cpu_set
(
1000
)),
sys
.
getsizeof
(
posix
.
cpu_set
(
1
)))
def
test_rtld_constants
(
self
):
# check presence of major RTLD_* constants
posix
.
RTLD_LAZY
...
...
Misc/NEWS
Dosyayı görüntüle @
5323173d
...
...
@@ -373,6 +373,9 @@ Library
-
Issue
#
15487
:
Add
a
__sizeof__
implementation
for
buffered
I
/
O
objects
.
Patch
by
Serhiy
Storchaka
.
-
Issue
#
15514
:
Correct
__sizeof__
support
for
cpu_set
.
Patch
by
Serhiy
Storchaka
.
-
Issue
#
15187
:
Bugfix
:
remove
temporary
directories
test_shutil
was
leaving
behind
.
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
5323173d
...
...
@@ -5772,6 +5772,20 @@ cpu_set_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
return
(
PyObject
*
)
make_new_cpu_set
(
type
,
size
);
}
PyDoc_STRVAR
(
cpu_set_sizeof_doc
,
"cpu_set.__sizeof__() -> int
\n\n
\
Returns size in memory, in bytes."
);
static
PyObject
*
cpu_set_sizeof
(
Py_cpu_set
*
set
,
PyObject
*
noargs
)
{
Py_ssize_t
res
=
0
;
res
=
sizeof
(
Py_cpu_set
);
res
+=
set
->
size
;
return
PyLong_FromSsize_t
(
res
);
}
static
PyObject
*
cpu_set_repr
(
Py_cpu_set
*
set
)
{
...
...
@@ -5959,6 +5973,7 @@ static PyMethodDef cpu_set_methods[] = {
{
"isset"
,
(
PyCFunction
)
cpu_set_isset
,
METH_VARARGS
,
cpu_set_isset_doc
},
{
"set"
,
(
PyCFunction
)
cpu_set_set
,
METH_VARARGS
,
cpu_set_set_doc
},
{
"zero"
,
(
PyCFunction
)
cpu_set_zero
,
METH_NOARGS
,
cpu_set_zero_doc
},
{
"__sizeof__"
,
(
PyCFunction
)
cpu_set_sizeof
,
METH_NOARGS
,
cpu_set_sizeof_doc
},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
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