~ubuntu-branches/ubuntu/oneiric/python2.5/oneiric

« back to all changes in this revision

Viewing changes to Python/marshal.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-12-21 08:57:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081221085749-bijjr25h8na5jdsu
Tags: 2.5.3-0ubuntu1
* New upstream version.
* Regenerate the included documentation.
* Add an option --install-layout=deb, which is ignored for 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        if (p->str == NULL)
66
66
                return; /* An error already occurred */
67
67
        size = PyString_Size(p->str);
68
 
        newsize = size + 1024;
 
68
        newsize = size + size + 1024;
 
69
        if (newsize > 32*1024*1024) {
 
70
                newsize = size + (size >> 3);   /* 12.5% overallocation */
 
71
        }
69
72
        if (_PyString_Resize(&p->str, newsize) != 0) {
70
73
                p->ptr = p->end = NULL;
71
74
        }