Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r2803:0e25c5c3fa14
Date: 2016-10-29 16:02 +0200
http://bitbucket.org/cffi/cffi/changeset/0e25c5c3fa14/

Log:    Add a note

diff --git a/doc/source/ref.rst b/doc/source/ref.rst
--- a/doc/source/ref.rst
+++ b/doc/source/ref.rst
@@ -262,7 +262,9 @@
 ``p`` was returned by ``ffi.new("struct foo *", ...)``, then
 ``ffi.sizeof(p[0])`` now returns the total allocated size.  In previous
 versions, it used to just return ``ffi.sizeof(ffi.typeof(p[0]))``, which
-is the size of the structure ignoring the variable-sized part.
+is the size of the structure ignoring the variable-sized part.  (Note
+that due to alignment, it is possible for ``ffi.sizeof(p[0])`` to return
+a value smaller than ``ffi.sizeof(ffi.typeof(p[0]))``.)
 
 **ffi.alignof("C type")**: return the natural alignment size in bytes of
 the argument.  Corresponds to the ``__alignof__`` operator in GCC.
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to