Mercurial > cpython-lru_cache-weakref
diff Include/bytesobject.h @ 42669:2c51be9904de
Code review of the new buffer protocol. Mostly add questions that should
be answered with the comments removed.
There are many places that require checks when doing arithmetic for memory
sizes when allocating memory. Otherwise, overflow is possible with
a subsequent crash.
Fix SF #1777057 which was a result of not initializing the new BufferError
properly. Had to update the test for exceptions for BufferError too.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 19 Aug 2007 04:23:20 +0000 |
| parents | 85c22b4d4455 |
| children | bb288e04b8e5 |
line wrap: on
line diff
--- a/Include/bytesobject.h Sat Aug 18 22:05:58 2007 +0000 +++ b/Include/bytesobject.h Sun Aug 19 04:23:20 2007 +0000 @@ -21,6 +21,7 @@ /* Object layout */ typedef struct { PyObject_VAR_HEAD + /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ int ob_exports; /* how many buffer exports */ Py_ssize_t ob_alloc; /* How many bytes allocated */ char *ob_bytes;
