From: Cyrill G. <gor...@gm...> - 2014-05-11 20:59:54
|
On Sun, May 11, 2014 at 01:03:35PM -0700, anonymous coward wrote: > > debug: Drop LOGALLOC usage > > > > There are special tools (like valgrind and etc) > > to track memory leaks, no need for own trivial > > tracker. > > I hereby request that this change be undone. > > This functionality has found bugs in the past. > Not everyone has the patience to mess with > third party memory tracking tools. And, last > but not least, this code does not seem to be > a maintenance nightmare. Well, the idea of all this initiative is to shrink the nasm code moving out all unneeded parts. Frankly I believe we should not carry the things which are known to be handled a way better by mem-tracking tools. Moreover you don't need much patience to work with say valgrind. Just compile nasm with debug info and it inform you the places which are leaking memory. [cyrill@moon nasm.git] valgrind --leak-check=full --show-reachable=yes ./nasm -fbin br3392278.asm ==32117== Memcheck, a memory error detector ==32117== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==32117== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==32117== Command: ./nasm -fbin br3392278.asm ==32117== ==32117== ==32117== HEAP SUMMARY: ==32117== in use at exit: 143 bytes in 6 blocks ==32117== total heap usage: 4,861 allocs, 4,855 frees, 1,531,217 bytes allocated ==32117== ==32117== 1 bytes in 1 blocks are still reachable in loss record 1 of 3 ==32117== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32117== by 0x4075F4: nasm_malloc (nasmlib.c:109) ==32117== by 0x402AAD: quote_for_make (nasm.c:583) ==32117== by 0x40189A: main (nasm.c:373) ==32117== ==32117== 14 bytes in 1 blocks are still reachable in loss record 2 of 3 ==32117== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32117== by 0x407758: nasm_strdup (nasmlib.c:180) ==32117== by 0x40871C: src_get (nasmlib.c:640) ==32117== by 0x40DD27: out (assemble.c:343) ==32117== by 0x410F33: gencode (assemble.c:1767) ==32117== by 0x40DA2E: assemble (assemble.c:663) ==32117== by 0x404FF8: assemble_file (nasm.c:1743) ==32117== by 0x401D38: main (nasm.c:473) ==32117== ==32117== 128 bytes in 4 blocks are definitely lost in loss record 3 of 3 ==32117== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32117== by 0x4075F4: nasm_malloc (nasmlib.c:109) ==32117== by 0x44B969: pp_reset (preproc.c:4884) ==32117== by 0x403009: assemble_file (nasm.c:1227) ==32117== by 0x401D38: main (nasm.c:473) ==32117== ==32117== LEAK SUMMARY: ==32117== definitely lost: 128 bytes in 4 blocks ==32117== indirectly lost: 0 bytes in 0 blocks ==32117== possibly lost: 0 bytes in 0 blocks ==32117== still reachable: 15 bytes in 2 blocks ==32117== suppressed: 0 bytes in 0 blocks ==32117== ==32117== For counts of detected and suppressed errors, rerun with: -v ==32117== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2) [cyrill@moon nasm.git] |