[Python-checkins] python/dist/src/Misc NEWS,1.474,1.475

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Mon, 19 Aug 2002 14:43:20 -0700


Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv2517/Misc

Modified Files:
	NEWS 
Log Message:
SF patch 576101, by Oren Tirosh: alternative implementation of
interning.  I modified Oren's patch significantly, but the basic idea
and most of the implementation is unchanged.  Interned strings created
with PyString_InternInPlace() are now mortal, and you must keep a
reference to the resulting string around; use the new function
PyString_InternImmortal() to create immortal interned strings.



Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.474
retrieving revision 1.475
diff -C2 -d -r1.474 -r1.475
*** NEWS	19 Aug 2002 16:25:46 -0000	1.474
--- NEWS	19 Aug 2002 21:43:18 -0000	1.475
***************
*** 58,61 ****
--- 58,65 ----
  Core and builtins
  
+ - A subtle change to the semantics of the built-in function intern():
+   interned strings are no longer immortal.  You must keep a reference
+   to the return value intern() around to get the benefit.
+ 
  - Use of 'None' as a variable, argument or attribute name now
    issues a SyntaxWarning.  In the future, None may become a keyword.
***************
*** 514,517 ****
--- 518,534 ----
  
  C API
+ 
+ - The string object's layout has changed: the pointer member
+   ob_sinterned has been replaced by an int member ob_sstate.  On some
+   platforms (e.g. most 64-bit systems) this may change the offset of
+   the ob_sval member, so as a precaution the API_VERSION has been
+   incremented.  The apparently unused feature of "indirect interned
+   strings", supported by the ob_sinterned member, is gone.  Interned
+   strings are now usually mortal; theres a new API,
+   PyString_InternImmortal() that creates immortal interned strings.
+   (The ob_sstate member can only take three values; however, while
+   making it a char saves a few bytes per string object on average, in
+   it also slowed things down a bit because ob_sval was no longer
+   aligned.)
  
  - The Py_InitModule*() functions now accept NULL for the 'methods'