[ctypes-commit] ctypes/source _ctypes.c,1.266,1.267
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-04-01 08:30:56
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19872 Modified Files: _ctypes.c Log Message: Todo comment. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.266 retrieving revision 1.267 diff -C2 -d -r1.266 -r1.267 *** _ctypes.c 1 Apr 2005 07:32:01 -0000 1.266 --- _ctypes.c 1 Apr 2005 08:30:47 -0000 1.267 *************** *** 2225,2232 **** /* We could save this time if the buffer in this case would be part of the object already */ obj->b_ptr = PyMem_Malloc(size); - obj->b_size = size; obj->b_needsfree = 1; memset(obj->b_ptr, 0, size); } return (PyObject *)obj; --- 2225,2236 ---- /* We could save this time if the buffer in this case would be part of the object already */ + + /* In python 2.4, and ctypes 0.9.6, the malloc call takes about + 33% of the creation time for c_int(). + */ obj->b_ptr = PyMem_Malloc(size); obj->b_needsfree = 1; memset(obj->b_ptr, 0, size); + obj->b_size = size; } return (PyObject *)obj; |