1. 14 Şub, 2010 1 kayıt (commit)
  2. 10 Ara, 2009 1 kayıt (commit)
  3. 28 Eyl, 2009 1 kayıt (commit)
    • Kristján Valur Jónsson's avatar
      http://bugs.python.org/issue6836 · 02ca57ce
      Kristján Valur Jónsson yazdı
      The debug memory api now keeps track of which external API (PyMem_* or PyObject_*) was used to allocate each block and treats any API violation as an error.  Added separate _PyMem_DebugMalloc functions for the Py_Mem API instead of having it use the _PyObject_DebugMalloc functions.
      02ca57ce
  4. 22 Tem, 2008 1 kayıt (commit)
    • Gregory P. Smith's avatar
      Issue #2620: Overflow checking when allocating or reallocating memory · 0470bab6
      Gregory P. Smith yazdı
      was not always being done properly in some python types and extension
      modules.  PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have
      all been updated to perform better checks and places in the code that
      would previously leak memory on the error path when such an allocation
      failed have been fixed.
      0470bab6
  5. 11 Haz, 2008 1 kayıt (commit)
    • Gregory P. Smith's avatar
      Merge in release25-maint r60793: · 9d53457e
      Gregory P. Smith yazdı
       Added checks for integer overflows, contributed by Google. Some are
       only available if asserts are left in the code, in cases where they
       can't be triggered from Python code.
      9d53457e
  6. 02 May, 2007 1 kayıt (commit)
  7. 26 Mar, 2006 1 kayıt (commit)
    • Tim Peters's avatar
      Years in the making. · c9d78aa4
      Tim Peters yazdı
      objimpl.h, pymem.h:  Stop mapping PyMem_{Del, DEL} and PyMem_{Free, FREE}
      to PyObject_{Free, FREE} in a release build.  They're aliases for the
      system free() now.
      
      _subprocess.c/sp_handle_dealloc():  Since the memory was originally
      obtained via PyObject_NEW, it must be released via PyObject_FREE (or
      _DEL).
      
      pythonrun.c, tokenizer.c, parsermodule.c:  I lost count of the number of
      PyObject vs PyMem mismatches in these -- it's like the specific
      function called at each site was picked at random, sometimes even with
      memory obtained via PyMem getting released via PyObject.  Changed most
      to use PyObject uniformly, since the blobs allocated are predictably
      small in most cases, and obmalloc is generally faster than system
      mallocs then.
      
      If extension modules in real life prove as sloppy as Python's front
      end, we'll have to revert the objimpl.h + pymem.h part of this patch.
      Note that no problems will show up in a debug build (all calls still go
      thru obmalloc then). Problems will show up only in a release build, most
      likely segfaults.
      c9d78aa4
  8. 23 Kas, 2002 1 kayıt (commit)
  9. 12 Agu, 2002 1 kayıt (commit)
  10. 28 Nis, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Moving pymalloc along. · 8b078f95
      Tim Peters yazdı
      As threatened, PyMem_{Free, FREE} also invoke the object deallocator now
      when pymalloc is enabled (well, it does when pymalloc isn't enabled too,
      but in that case "the object deallocator" is plain free()).
      
      This is maximally backward-compatible, but it leaves a bitter aftertaste.
      
      Also massive reworking of comments.
      8b078f95
  11. 22 Nis, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Moving pymalloc along. · 51e7f5ca
      Tim Peters yazdı
      + Redirect PyMem_{Del, DEL} to the object allocator's free() when
        pymalloc is enabled.  Needed so old extensions can continue to
        mix PyObject_New with PyMem_DEL.
      
      + This implies that pgen needs to be able to see the PyObject_XYZ
        declarations too.  pgenheaders.h now includes Python.h.  An
        implication is that I expect obmalloc.o needs to get linked into
        pgen on non-Windows boxes.
      
      + When PYMALLOC_DEBUG is defined, *all* Py memory API functions
        now funnel through the debug allocator wrapper around pymalloc.
        This is the default in a debug build.
      
      + That caused compile.c to fail:  it indirectly mixed PyMem_Malloc
        with raw platform free() in one place.  This is verbotten.
      51e7f5ca
  12. 12 Nis, 2002 2 kayıt (commit)
    • Tim Peters's avatar
      First stab at rationalizing the PyMem_ API. Mixing PyObject_xyz with · af3e8de5
      Tim Peters yazdı
      PyMem_{Del, DEL} doesn't work yet (compilation problems).
      
      pyport.h:  _PyMem_EXTRA is gone.
      
      pmem.h:  Repaired comments.  PyMem_{Malloc, MALLOC} and
      PyMem_{Realloc, REALLOC} now make the same x-platform guarantees when
      asking for 0 bytes, and when passing a NULL pointer to the latter.
      
      object.c:  PyMem_{Malloc, Realloc} just call their macro versions
      now, since the latter take care of the x-platform 0 and NULL stuff
      by themselves now.
      
      pypcre.c, grow_stack():  So sue me.  On two lines, this called
      PyMem_RESIZE to grow a "const" area.  It's not legit to realloc a
      const area, so the compiler warned given the new expansion of
      PyMem_RESIZE.  It would have gotten the same warning before if it
      had used PyMem_Resize() instead; the older macro version, but not the
      function version, silently cast away the constness.  IMO that was a wrong
      thing to do, and the docs say the macro versions of PyMem_xyz are
      deprecated anyway.  If somebody else is resizing const areas with the
      macro spelling, they'll get a warning when they recompile now too.
      af3e8de5
    • Neil Schemenauer's avatar
      20d0a1a0
  13. 01 Nis, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      New PYMALLOC_DEBUG function void _PyMalloc_DebugDumpStats(void). · 7ccfadf3
      Tim Peters yazdı
      This displays stats about the # of arenas, pools, blocks and bytes, to
      stderr, both used and reserved but unused.
      
      CAUTION:  Because PYMALLOC_DEBUG is on, the debug malloc routine adds
      16 bytes to each request.  This makes each block appear two size classes
      higher than it would be if PYMALLOC_DEBUG weren't on.
      
      So far, playing with this confirms the obvious:  there's a lot of activity
      in the "small dict" size class, but nothing in the core makes any use of
      the 8-byte or 16-byte classes.
      7ccfadf3
  14. 28 Mar, 2002 1 kayıt (commit)
  15. 23 Mar, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Give Python a debug-mode pymalloc, much as sketched on Python-Dev. · ddea208b
      Tim Peters yazdı
      When WITH_PYMALLOC is defined, define PYMALLOC_DEBUG to enable the debug
      allocator.  This can be done independent of build type (release or debug).
      A debug build automatically defines PYMALLOC_DEBUG when pymalloc is
      enabled.  It's a detected error to define PYMALLOC_DEBUG when pymalloc
      isn't enabled.
      
      Two debugging entry points defined only under PYMALLOC_DEBUG:
      
      + _PyMalloc_DebugCheckAddress(const void *p) can be used (e.g., from gdb)
        to sanity-check a memory block obtained from pymalloc.  It sprays
        info to stderr (see next) and dies via Py_FatalError if the block is
        detectably damaged.
      
      + _PyMalloc_DebugDumpAddress(const void *p) can be used to spray info
        about a debug memory block to stderr.
      
      A tiny start at implementing "API family" checks isn't good for
      anything yet.
      
      _PyMalloc_DebugRealloc() has been optimized to do little when the new
      size is <= old size.  However, if the new size is larger, it really
      can't call the underlying realloc() routine without either violating its
      contract, or knowing something non-trivial about how the underlying
      realloc() works.  A memcpy is always done in this case.
      
      This was a disaster for (and only) one of the std tests:  test_bufio
      creates single text file lines up to a million characters long.  On
      Windows, fileobject.c's get_line() uses the horridly funky
      getline_via_fgets(), which keeps growing and growing a string object
      hoping to find a newline.  It grew the string object 1000 bytes each
      time, so for a million-character string it took approximately forever
      (I gave up after a few minutes).
      
      So, also:
      
      fileobject.c, getline_via_fgets():  When a single line is outrageously
      long, grow the string object at a mildly exponential rate, instead of
      just 1000 bytes at a time.
      
      That's enough so that a debug-build test_bufio finishes in about 5 seconds
      on my Win98SE box.  I'm curious to try this on Win2K, because it has very
      different memory behavior than Win9X, and test_bufio always took a factor
      of 10 longer to complete on Win2K.  It *could* be that the endless
      reallocs were simply killing it on Win2K even in the release build.
      ddea208b
  16. 20 Mar, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Arrange to export the _PyMalloc_{Malloc, Realloc, Free} entry points. On · fbb556df
      Tim Peters yazdı
      Windows some modules are considered (by me, and I don't care what anyone
      else thinks about this <wink>) to be part of "the core" despite that they
      happen to be compiled into separate DLLs (the "to DLL or not to DLL?"
      question on Windows is nearly arbitrary).  Making the pymalloc entry
      points available to them allows the Windows build to complete without
      incident when WITH_PYMALLOC is #define'd.
      
      Note that this isn't unprecedented.  Other "private API" functions we
      export include _PySequence_IterSearch, _PyEval_SliceIndex, _PyCodec_Lookup,
      _Py_ZeroStruct, _Py_TrueStruct, _PyLong_New and _PyModule_Clear.
      fbb556df
  17. 18 Mar, 2002 2 kayıt (commit)
  18. 02 Mar, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Whether platform malloc(0) returns NULL has nothing to do with whether · a5d78cc2
      Tim Peters yazdı
      platform realloc(p, 0) returns NULL, so MALLOC_ZERO_RETURNS_NULL can
      be correctly undefined yet realloc(p, 0) can return NULL anyway.
      
      Prevent realloc(p, 0) doing free(p) and returning NULL via a different
      hack.  Would probably be better to get rid of MALLOC_ZERO_RETURNS_NULL
      entirely.
      
      Bugfix candidate.
      a5d78cc2
  19. 26 Tem, 2001 1 kayıt (commit)
  20. 01 Eyl, 2000 1 kayıt (commit)
  21. 13 Agu, 2000 1 kayıt (commit)
  22. 31 Tem, 2000 2 kayıt (commit)
  23. 25 Tem, 2000 1 kayıt (commit)
  24. 12 Tem, 2000 1 kayıt (commit)
  25. 09 Tem, 2000 1 kayıt (commit)
  26. 30 Haz, 2000 2 kayıt (commit)
  27. 05 May, 2000 1 kayıt (commit)
  28. 03 May, 2000 1 kayıt (commit)
    • Guido van Rossum's avatar
      Vladimir Marangozov's long-awaited malloc restructuring. · b18618da
      Guido van Rossum yazdı
      For more comments, read the patches@python.org archives.
      For documentation read the comments in mymalloc.h and objimpl.h.
      
      (This is not exactly what Vladimir posted to the patches list; I've
      made a few changes, and Vladimir sent me a fix in private email for a
      problem that only occurs in debug mode.  I'm also holding back on his
      change to main.c, which seems unnecessary to me.)
      b18618da
  29. 04 Ara, 1998 1 kayıt (commit)
  30. 21 Agu, 1997 1 kayıt (commit)
  31. 05 Agu, 1997 1 kayıt (commit)
  32. 10 Tem, 1997 1 kayıt (commit)
  33. 07 May, 1997 1 kayıt (commit)
  34. 25 Eki, 1996 1 kayıt (commit)
  35. 27 Haz, 1995 1 kayıt (commit)
  36. 18 Şub, 1995 1 kayıt (commit)