Mailing List Archive

CVS: python/dist/src/Objects stringobject.c,2.152,2.153
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv6238/python/Objects

Modified Files:
stringobject.c
Log Message:
Eliminate DONT_SHARE_SHORT_STRINGS.


Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.152
retrieving revision 2.153
diff -C2 -d -r2.152 -r2.153
*** stringobject.c 29 Mar 2002 03:29:07 -0000 2.152
--- stringobject.c 30 Mar 2002 10:06:07 -0000 2.153
***************
*** 15,21 ****

static PyStringObject *characters[UCHAR_MAX + 1];
- #ifndef DONT_SHARE_SHORT_STRINGS
static PyStringObject *nullstring;
- #endif

/*
--- 15,19 ----
***************
*** 48,52 ****
{
register PyStringObject *op;
- #ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0 && (op = nullstring) != NULL) {
#ifdef COUNT_ALLOCS
--- 46,49 ----
***************
*** 65,69 ****
return (PyObject *)op;
}
- #endif /* DONT_SHARE_SHORT_STRINGS */

/* PyObject_NewVar is inlined */
--- 62,65 ----
***************
*** 78,82 ****
memcpy(op->ob_sval, str, size);
op->ob_sval[size] = '\0';
! #ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0) {
PyObject *t = (PyObject *)op;
--- 74,78 ----
memcpy(op->ob_sval, str, size);
op->ob_sval[size] = '\0';
! /* share short strings */
if (size == 0) {
PyObject *t = (PyObject *)op;
***************
*** 92,96 ****
Py_INCREF(op);
}
- #endif
return (PyObject *) op;
}
--- 88,91 ----
***************
*** 109,113 ****
return NULL;
}
- #ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0 && (op = nullstring) != NULL) {
#ifdef COUNT_ALLOCS
--- 104,107 ----
***************
*** 124,128 ****
return (PyObject *)op;
}
- #endif /* DONT_SHARE_SHORT_STRINGS */

/* PyObject_NewVar is inlined */
--- 118,121 ----
***************
*** 135,139 ****
op->ob_sinterned = NULL;
memcpy(op->ob_sval, str, size+1);
! #ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0) {
PyObject *t = (PyObject *)op;
--- 128,132 ----
op->ob_sinterned = NULL;
memcpy(op->ob_sval, str, size+1);
! /* share short strings */
if (size == 0) {
PyObject *t = (PyObject *)op;
***************
*** 149,153 ****
Py_INCREF(op);
}
- #endif
return (PyObject *) op;
}
--- 142,145 ----
***************
*** 3638,3645 ****
characters[i] = NULL;
}
- #ifndef DONT_SHARE_SHORT_STRINGS
Py_XDECREF(nullstring);
nullstring = NULL;
- #endif
if (interned) {
int pos, changed;
--- 3630,3635 ----