Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9788384d
Commit
9788384d
authored
May 31, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explain that tp_basicsize must provide alignment for the items.
parent
ebb41907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Doc/api/newtypes.tex
Doc/api/newtypes.tex
+8
-0
No files found.
Doc/api/newtypes.tex
View file @
9788384d
...
...
@@ -465,6 +465,14 @@ Foo_Type.ob_type = &PyType_Type;
has a non-zero
\member
{
tp
_
itemsize
}
, it is generally not safe to set
\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}
\begin{cmemberdesc}
{
PyTypeObject
}{
destructor
}{
tp
_
dealloc
}
...
...
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