1. 19 Ara, 2007 1 kayıt (commit)
  2. 21 Tem, 2007 1 kayıt (commit)
  3. 25 Şub, 2007 1 kayıt (commit)
    • Neal Norwitz's avatar
      Variation of patch # 1624059 to speed up checking if an object is a subclass · ee3a1b52
      Neal Norwitz yazdı
      of some of the common builtin types.
      
      Use a bit in tp_flags for each common builtin type.  Check the bit
      to determine if any instance is a subclass of these common types.
      The check avoids a function call and O(n) search of the base classes.
      The check is done in the various Py*_Check macros rather than calling
      PyType_IsSubtype().
      
      All the bits are set in tp_flags when the type is declared
      in the Objects/*object.c files because PyType_Ready() is not called
      for all the types.  Should PyType_Ready() be called for all types?
      If so and the change is made, the changes to the Objects/*object.c files
      can be reverted (remove setting the tp_flags).  Objects/typeobject.c
      would also have to be modified to add conditions
      for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
      ee3a1b52
  4. 15 Şub, 2006 1 kayıt (commit)
  5. 28 Eki, 2004 1 kayıt (commit)
    • Armin Rigo's avatar
      Wrote down the invariants of some common objects whose structure is · 89a39461
      Armin Rigo yazdı
      exposed in header files.  Fixed a few comments in these headers.
      
      As we might have expected, writing down invariants systematically exposed a
      (minor) bug.  In this case, function objects have a writeable func_code
      attribute, which could be set to code objects with the wrong number of
      free variables.  Calling the resulting function segfaulted the interpreter.
      Added a corresponding test.
      89a39461
  6. 01 Agu, 2004 1 kayıt (commit)
  7. 29 Tem, 2004 3 kayıt (commit)
    • Armin Rigo's avatar
      * drop the unreasonable list invariant that ob_item should never come back · 93677f07
      Armin Rigo yazdı
        to NULL during the lifetime of the object.
      
      * listobject.c nevertheless did not conform to the other invariants,
        either; fixed.
      
      * listobject.c now uses list_clear() as the obvious internal way to clear
        a list, instead of abusing list_ass_slice() for that.  It makes it easier
        to enforce the invariant about ob_item == NULL.
      
      * listsort() sets allocated to -1 during sort; any mutation will set it
        to a value >= 0, so it is a safe way to detect mutation.  A negative
        value for allocated does not cause a problem elsewhere currently.
        test_sort.py has a new test for this fix.
      
      * listsort() leak: if items were added to the list during the sort, AND if
        these items had a __del__ that puts still more stuff into the list,
        then this more stuff (and the PyObject** array to hold them) were
        overridden at the end of listsort() and never released.
      93677f07
    • Tim Peters's avatar
      Fix obscure breakage (relative to 2.3) in listsort: the test for list · 51b4ade3
      Tim Peters yazdı
      mutation during list.sort() used to rely on that listobject.c always
      NULL'ed ob_item when ob_size fell to 0.  That's no longer true, so the
      test for list mutation during a sort is no longer reliable.  Changed the
      test to rely instead on that listobject.c now never NULLs-out ob_item
      after (if ever) ob_item gets a non-NULL value.  This new assumption is
      also documented now, as a required invariant in listobject.h.
      
      The new assumption allowed some real simplification to some of the
      hairier code in listsort(), so is a Good Thing on that count.
      51b4ade3
    • Tim Peters's avatar
      Document what the members of PyListObject are used for, and the crucial · a995a2dd
      Tim Peters yazdı
      invariants they must satisfy.
      a995a2dd
  8. 11 Mar, 2004 1 kayıt (commit)
  9. 13 Şub, 2004 1 kayıt (commit)
    • Raymond Hettinger's avatar
      * Optimized list appends and pops by making fewer calls the underlying system · 4bb9540d
      Raymond Hettinger yazdı
        realloc().  This is achieved by tracking the overallocation size in a new
        field and using that information to skip calls to realloc() whenever
        possible.
      
      * Simplified and tightened the amount of overallocation.  For larger lists,
        this overallocates by 1/8th (compared to the previous scheme which ranged
        between 1/4th to 1/32nd over-allocation).  For smaller lists (n<6), the
        maximum overallocation is one byte (formerly it could be upto eight bytes).
        This saves memory in applications with large numbers of small lists.
      
      * Eliminated the NRESIZE macro in favor of a new, static list_resize function
        that encapsulates the resizing logic.  Coverting this back to macro would
        give a small (under 1%) speed-up.  This was too small to warrant the loss
        of readability, maintainability, and de-coupling.
      
      * Some functions using NRESIZE had grown unnecessarily complex in their
        efforts to bend to the macro's calling pattern.  With the new list_resize
        function in place, those other functions could be simplified.  That is
        being saved for a separate patch.
      
      * The ob_item==NULL check could be eliminated from the new list_resize
        function.  This would entail finding each piece of code that sets ob_item
        to NULL and adding a new line to invalidate the overallocation tracking
        field.  Rather than impose a new requirement on other pieces of list code,
        it was preferred to leave the NULL check in place and retain the benefits
        of decoupling, maintainability and information hiding (only PyList_New()
        and list_sort() need to know about the new field).  This approach also
        reduces the odds of breaking an extension module.
      
      (Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
       and Armin Rigo.)
      4bb9540d
  10. 08 Şub, 2004 2 kayıt (commit)
  11. 12 Agu, 2002 1 kayıt (commit)
  12. 05 Eki, 2001 1 kayıt (commit)
  13. 02 Agu, 2001 1 kayıt (commit)
  14. 01 Eyl, 2000 1 kayıt (commit)
  15. 09 Tem, 2000 1 kayıt (commit)
  16. 30 Haz, 2000 2 kayıt (commit)
  17. 01 Mar, 2000 1 kayıt (commit)
  18. 04 Ara, 1998 1 kayıt (commit)
  19. 24 Nis, 1998 1 kayıt (commit)
  20. 06 Ock, 1997 1 kayıt (commit)
  21. 25 Eki, 1996 1 kayıt (commit)
  22. 27 Şub, 1995 1 kayıt (commit)
  23. 20 Ock, 1995 1 kayıt (commit)
  24. 17 Ock, 1995 1 kayıt (commit)
  25. 12 Ock, 1995 1 kayıt (commit)
  26. 04 Ock, 1995 1 kayıt (commit)
    • Guido van Rossum's avatar
      Added 1995 copyright. · 5799b520
      Guido van Rossum yazdı
      object.h: made sizes and refcnts signed ints.
      stringobject.h: make getstrsize() signed int.
      methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
      5799b520
  27. 18 Agu, 1994 1 kayıt (commit)
  28. 01 Agu, 1994 1 kayıt (commit)
  29. 28 Tem, 1993 1 kayıt (commit)
    • Guido van Rossum's avatar
      * Added support for X11 modules. · a3309960
      Guido van Rossum yazdı
      * Makefile: change location of FORMS library.
      * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not)
      * Almost all .h files: added CPP magic to avoid duplicate inclusions and
        to support inclusion from C++.
      a3309960
  30. 17 Haz, 1993 1 kayıt (commit)
    • Guido van Rossum's avatar
      * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c. · 234f942a
      Guido van Rossum yazdı
        Added $(SYSDEF) to its build rule in Makefile.
      * cgensupport.[ch], modsupport.[ch]: removed some old stuff.  Also
        changed files that still used it...  And made several things static
        that weren't but should have been...  And other minor cleanups...
      * listobject.[ch]: add external interfaces {set,get}listslice
      * socketmodule.c: fix bugs in new send() argument parsing.
      * sunaudiodevmodule.c: added flush() and close().
      234f942a
  31. 29 Mar, 1993 1 kayıt (commit)
    • Guido van Rossum's avatar
      * Changed all copyright messages to include 1993. · 9bfef44d
      Guido van Rossum yazdı
      * Stubs for faster implementation of local variables (not yet finished)
      * Added function name to code object.  Print it for code and function
        objects.  THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version
        number has changed accordingly)
      * Print address of self for built-in methods
      * New internal functions getattro and setattro (getattr/setattr with
        string object arg)
      * Replaced "dictobject" with more powerful "mappingobject"
      * New per-type functio tp_hash to implement arbitrary object hashing,
        and hashobject() to interface to it
      * Added built-in functions hash(v) and hasattr(v, 'name')
      * classobject: made some functions static that accidentally weren't;
        added __hash__ special instance method to implement hash()
      * Added proper comparison for built-in methods and functions
      9bfef44d
  32. 05 Nis, 1992 1 kayıt (commit)
  33. 19 Şub, 1991 1 kayıt (commit)
  34. 20 Ara, 1990 1 kayıt (commit)
  35. 30 Eki, 1990 1 kayıt (commit)
  36. 14 Eki, 1990 1 kayıt (commit)