[Python-checkins] python/dist/src/Doc/api newtypes.tex,1.12,1.13
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
2002年5月31日 14:00:20 -0700
Update of /cvsroot/python/python/dist/src/Doc/api
In directory usw-pr-cvs1:/tmp/cvs-serv24520
Modified Files:
newtypes.tex
Log Message:
Explain that tp_basicsize must provide alignment for the items.
Index: newtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** newtypes.tex 24 Apr 2002 06:35:11 -0000 1.12
--- newtypes.tex 31 May 2002 21:00:18 -0000 1.13
***************
*** 466,469 ****
--- 466,477 ----
\member{tp_itemsize} to a different non-zero value in a subtype
(though this depends on the implementation of the base type).
+
+ A note about alignment: if the variable items require a particular
+ alignment, this should be taken care of by the value of
+ \member{tp_basicsize}. Example: suppose a type implements an array
+ of \code{double}. \member{tp_itemsize} is \code{sizeof(double)}.
+ It is the programmer's responsibility that \member{tp_basicsize} is
+ a multiple of \code{sizeof(double)} (assuming this is the alignment
+ requirement for \code{double}).
\end{cmemberdesc}