Author vstinner
Recipients remi.lapeyre, ronaldoussoren, skrah, vstinner
Date 2020-06-10.13:40:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591796453.5.0.721171654126.issue40928@roundup.psfhosted.org>
In-reply-to
Content
> Would it be possible to wrap malloc_print_configure() (https://github.com/PureDarwin/libmalloc/blob/e37056265821cd6e014ab911d9fe3b9d0da88e22/src/malloc_printf.c#L59) in a context manager that we put in test.support? or to override https://github.com/PureDarwin/libmalloc/blob/e37056265821cd6e014ab911d9fe3b9d0da88e22/src/malloc_printf.c#L36?

I don't see much benefit of having a feature which only works on macOS.

You can put a hook on memory allocations using PyMem_SetAllocator() to trigger any action you want when any memory allocation done by Python fails.

But is it really an use case to log any memory allocation failure? Python is very likely to raise a MemoryError exception in this case. It's well defined, no?
History
Date User Action Args
2020-06-10 13:40:53vstinnersetrecipients: + vstinner, ronaldoussoren, skrah, remi.lapeyre
2020-06-10 13:40:53vstinnersetmessageid: <1591796453.5.0.721171654126.issue40928@roundup.psfhosted.org>
2020-06-10 13:40:53vstinnerlinkissue40928 messages
2020-06-10 13:40:53vstinnercreate