Re: malloc options incompatibility between phkmalloc and jemalloc

From: Jason Evans <jasone_at_FreeBSD.org>
Date: Mon, 13 Mar 2006 12:52:31 -0800
SANETO Takanori wrote:
> I don't think this is serious problem, but it's annoying.
> 
> When I put 'k' in /etc/malloc.conf, some commands (cvsup and
> vmware-checkvm) show warning about unknown character. These commands
> seem to have phkmalloc implementation linked statically.
> 
> On the other hand, when I put '>' in /etc/malloc.conf, many commands
> will show warnings.
> 
> For second case, isn't it reasonable for jemalloc to just ignore
> phkmalloc specific characters?
> For first case, how about introducing new option source (i.e.
> /etc/jemalloc.conf, JEMALLOC_OPTIONS or something like that)?
> 
> What do you think?

This is a sticky issue.  I'd rather leave things as they are, partly 
because I expect the "fix" would actually be quite messy.  I view malloc 
options as pretty much exclusively a devel/debug aid, rather than a 
stable API.  In order to truly fix this API, I think we'd have to go 
further than what you suggest.  The _malloc_options global variable is 
harder to deal with than MALLOC_OPTIONS or /etc/malloc.conf when trying 
to design a fix.

The problem for _malloc_options is that we can't reliably use a 
function-based API, since malloc may be called before the application 
has a chance to configure the allocator.  As such, there is no direct 
way for an app to respond to malloc option incompatibilities.

It would be possible to construct a more complex interface for malloc 
configuration that would mostly solve these issues, but I don't think 
it's worth the added complexity for a devel/debug facility.

Jason
Received on Mon Mar 13 2006 - 19:53:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC