This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xmmalloc?


On Sep 20,  3:55pm, David Carlton wrote:

> Does GDB currently use xmmalloc in any consistent way?

It may have at one time, but I don't think it does any longer.

> When writing
> functions that might call xmalloc, should I try to write versions that
> call xmmalloc instead and try to find an appropriate md to pass to
> them?  If I don't do that but instead just use xmalloc, will anything
> bad happen?  In particular, am I opening up myself to any new
> possible memory leaks, other than the ones that are, of course, always
> possible when calling xmalloc?

In my opinion, we should just use xmalloc().

> Any background info on this would be appreciated.

See http://sources.redhat.com/gdb/5/onlinedocs/mmalloc.html

Basically, mmalloc was a library which used mmap() for doing
allocations.  If done right, this could be used to implement a saved
state mechanism, but I don't think we've been careful enough in GDB in
recent years for this stuff to still work.  If someone knows if it
ever worked I'd like to hear about the capabilities that it gave
GDB.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]