This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] |
On Tue, Apr 17, 2018 at 10:21 AM, Tom de Vries <Tom_deVries@mentor.com> wrote: > On 04/17/2018 03:59 PM, Ian Lance Taylor wrote: >> >> The bug report https://github.com/ianlancetaylor/libbacktrace/issues/13 >> points out that when backtrace_full checks whether memory is >> available, it doesn't necessarily release that memory. It will stay >> on the free list, so libbacktrace will use more and more memory over >> time. This patch fixes that problem by explicitly calling munmap. >> Bootstrapped and ran libbacktrace and Go tests on x86_64-pc-linux-gnu. >> Committed to mainline. >> >> Ian >> >> >> 2018-04-17 Ian Lance Taylor <iant@golang.org> >> >> * backtrace.c (backtrace_full): When testing whether we can >> allocate memory, call mmap directly, and munmap the memory. >> >> >> patch.txt >> >> >> Index: backtrace.c >> =================================================================== >> --- backtrace.c (revision 259359) >> +++ backtrace.c (working copy) >> @@ -32,12 +32,26 @@ POSSIBILITY OF SUCH DAMAGE. */ >> #include "config.h" >> +#include <unistd.h> >> #include <sys/types.h> >> +#if !BACKTRACE_USES_MALLOC >> +#include <sys/mman.h> >> +#endif >> + > > > Hi, > > this breaks the nvptx build: > ... > libbacktrace/backtrace.c:39:10: fatal error: sys/mman.h: No such file or > directory > #include <sys/mman.h> > ^~~~~~~~~~~~ > compilation terminated. Sorry about that. Committed this patch, which should fix that problem. Ian 2018-04-17 Ian Lance Taylor <iant@golang.org> * backtrace.c: Include backtrace-supported.h before checking BACKTRACE_USES_MALLOC.
Attachment:
patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |