[Python-Dev] Debug entry points for PyMalloc

Aahz aahz@pythoncraft.com
2002年3月23日 19:54:08 -0500


On Sat, Mar 23, 2002, Tim Peters wrote:
> [Aahz]
>>>> I'm almost certainly betraying my ignorance here, but it sounds to
>> me like malloc isn't doing any sanity checking to make sure that the
>> memory it received isn't already being used.
>> Well, malloc doesn't receive memory, it allocates it, and
> _PyMalloc_DebugMalloc just wraps somebody *else's* malloc. It's not trying
> to debug the platform malloc, it's trying to debug "the user's" (Python's)
> use of the memory malloc returns.

Okay, you *really* meant it when you said that your debug wrapper
doesn't touch the underlying malloc() implmentation. ;-)
-- 
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
"We should forget about small efficiencies, about 97% of the time.
Premature optimization is the root of all evil." --Knuth

AltStyle によって変換されたページ (->オリジナル) /