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
82730f8d
Commit
82730f8d
authored
Mar 22, 2007
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explain the purpose of the b_needsfree flag (forward ported from release25-maint).
parent
f493cbd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes.c
+6
-0
No files found.
Modules/_ctypes/_ctypes.c
View file @
82730f8d
...
...
@@ -2181,6 +2181,12 @@ static void CData_MallocBuffer(CDataObject *obj, StgDictObject *dict)
if
((
size_t
)
dict
->
size
<=
sizeof
(
obj
->
b_value
))
{
/* No need to call malloc, can use the default buffer */
obj
->
b_ptr
=
(
char
*
)
&
obj
->
b_value
;
/* The b_needsfree flag does not mean that we actually did
call PyMem_Malloc to allocate the memory block; instead it
means we are the *owner* of the memory and are responsible
for freeing resources associated with the memory. This is
also the reason that b_needsfree is exposed to Python.
*/
obj
->
b_needsfree
=
1
;
}
else
{
/* In python 2.4, and ctypes 0.9.6, the malloc call took about
...
...
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