[Python-checkins] python/dist/src/Objects intobject.c, 2.105, 2.105.8.1

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Feb 8 13:56:09 EST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15839

Modified Files:
      Tag: release23-maint
	intobject.c 
Log Message:
SF patch #875689: >100k alloc wasted on startup
(Contributed by Mike Pall.)

Make sure fill_free_list() is called only once rather than 106 times
when pre-allocating small ints.



Index: intobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v
retrieving revision 2.105
retrieving revision 2.105.8.1
diff -C2 -d -r2.105 -r2.105.8.1
*** intobject.c	28 Jun 2003 20:04:24 -0000	2.105
--- intobject.c	8 Feb 2004 18:56:07 -0000	2.105.8.1
***************
*** 1081,1085 ****
  #if NSMALLNEGINTS + NSMALLPOSINTS > 0
  	for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) {
! 		if ((free_list = fill_free_list()) == NULL)
  			return 0;
  		/* PyObject_New is inlined */
--- 1081,1085 ----
  #if NSMALLNEGINTS + NSMALLPOSINTS > 0
  	for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) {
!               if (!free_list && (free_list = fill_free_list()) == NULL)
  			return 0;
  		/* PyObject_New is inlined */




More information about the Python-checkins mailing list