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
735abadd
Kaydet (Commit)
735abadd
authored
May 14, 2018
tarafından
Segev Finer
Kaydeden (comit)
Serhiy Storchaka
May 14, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
üst
d063b84d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
test_arrays.py
Lib/ctypes/test/test_arrays.py
+7
-0
2017-09-29-16-40-38.bpo-16865.l-f6I_.rst
...S.d/next/Library/2017-09-29-16-40-38.bpo-16865.l-f6I_.rst
+1
-0
_ctypes.c
Modules/_ctypes/_ctypes.c
+8
-8
No files found.
Lib/ctypes/test/test_arrays.py
Dosyayı görüntüle @
735abadd
import
unittest
from
test.support
import
bigmemtest
,
_2G
import
sys
from
ctypes
import
*
from
ctypes.test
import
need_symbol
...
...
@@ -181,5 +183,10 @@ class ArrayTestCase(unittest.TestCase):
_type_
=
c_int
_length_
=
1.87
@unittest.skipUnless
(
sys
.
maxsize
>
2
**
32
,
'requires 64bit platform'
)
@bigmemtest
(
size
=
_2G
,
memuse
=
1
,
dry_run
=
False
)
def
test_large_array
(
self
,
size
):
c_char
*
size
if
__name__
==
'__main__'
:
unittest
.
main
()
Misc/NEWS.d/next/Library/2017-09-29-16-40-38.bpo-16865.l-f6I_.rst
0 → 100644
Dosyayı görüntüle @
735abadd
Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer.
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
735abadd
...
...
@@ -1390,8 +1390,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
StgDictObject
*
stgdict
;
StgDictObject
*
itemdict
;
PyObject
*
length_attr
,
*
type_attr
;
long
length
;
int
overflow
;
Py_ssize_t
length
;
Py_ssize_t
itemsize
,
itemalign
;
/* create the new instance (which is a class,
...
...
@@ -1413,14 +1412,15 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_XDECREF
(
length_attr
);
goto
error
;
}
length
=
PyLong_AsLongAndOverflow
(
length_attr
,
&
overflow
);
if
(
overflow
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"The '_length_' attribute is too large"
);
Py_DECREF
(
length_attr
);
length
=
PyLong_AsSsize_t
(
length_attr
);
Py_DECREF
(
length_attr
);
if
(
length
==
-
1
&&
PyErr_Occurred
())
{
if
(
PyErr_ExceptionMatches
(
PyExc_OverflowError
))
{
PyErr_SetString
(
PyExc_OverflowError
,
"The '_length_' attribute is too large"
);
}
goto
error
;
}
Py_DECREF
(
length_attr
);
type_attr
=
PyObject_GetAttrString
((
PyObject
*
)
result
,
"_type_"
);
if
(
!
type_attr
)
{
...
...
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