Message134775
> Since I want PyMem_MALLOC to call dlmalloc, I would need to export the
> "malloc" symbol from libpython so that Python extensions could use it
> when calling PyMem_MALLOC, but that would impact all malloc calls in
> applications which embed Python for example.
Well, that would be a rather good thing. There are, IIRC, Python API
calls which require that the caller manually frees memory. If the API
call malloc()s memory with a certain allocator and the caller free()s it
with another allocator, the result won't be pretty :)
(a similar discrepancy occurs between function-based APIs and
macro-based APIs: functions get compiled inside the Python library while
macros get compiled within the embedding executable; if library and
application have an incompatible malloc()/free() pair, you will get
similarly funny results) |
|
Date |
User |
Action |
Args |
2011-04-29 15:45:41 | pitrou | set | recipients:
+ pitrou, tim.peters, loewis, sable, flub, neologix, BreamoreBoy |
2011-04-29 15:45:40 | pitrou | link | issue3526 messages |
2011-04-29 15:45:40 | pitrou | create | |
|