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]

Why malloc() when target code is executed?


Hello!

I just noticed that ``print printf("Hello\n")'' call malloc() on the target
to allocate the memory for the string. AFAICS, this memory never gets freed.
Is there any reason not to allocate this memory on the stack? This would
avoid this memory leak. In addition, this would make it possible to use this
feature on embedded systems which often have either restricted memory or
even dont have malloc() at all.

-- 
Please visit and sign http://petition-eurolinux.org and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --


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