[Python-checkins] python/dist/src/Objects intobject.c,2.107,2.108

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Feb 8 13:54:40 EST 2004


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

Modified Files:
	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.107
retrieving revision 2.108
diff -C2 -d -r2.107 -r2.108
*** intobject.c	29 Nov 2003 23:52:12 -0000	2.107
--- intobject.c	8 Feb 2004 18:54:37 -0000	2.108
***************
*** 1065,1069 ****
  #if NSMALLNEGINTS + NSMALLPOSINTS > 0
  	for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) {
! 		if ((free_list = fill_free_list()) == NULL)
  			return 0;
  		/* PyObject_New is inlined */
--- 1065,1069 ----
  #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