Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualAndreas Jonsson

Posted 04 March 2013 - 05:07 PM

Hmm. I couldn't reproduce this problem. 

 

I compiled the code you provided and ran it with valgrind as you did, but no problem was detected:

 

 

 
==17210== Memcheck, a memory error detector
==17210== Copyright © 2002-2012, and GNU GPL'd, by Julian Seward et al.
==17210== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==17210== Command: ./tutorial
==17210==
I believe!
==17210==
==17210== HEAP SUMMARY:
==17210==     in use at exit: 67,922 bytes in 366 blocks
==17210==   total heap usage: 766 allocs, 400 frees, 90,995 bytes allocated
==17210==
==17210== LEAK SUMMARY:
==17210==    definitely lost: 0 bytes in 0 blocks
==17210==    indirectly lost: 0 bytes in 0 blocks
==17210==      possibly lost: 35 bytes in 1 blocks
==17210==    still reachable: 67,887 bytes in 365 blocks
==17210==         suppressed: 0 bytes in 0 blocks
==17210== Rerun with --leak-check=full to see details of leaked memory
==17210==
==17210== For counts of detected and suppressed errors, rerun with: -v
==17210== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)

 

Observe, the memory leak that was detected is because you didn't release the context before existing. 


#1Andreas Jonsson

Posted 04 March 2013 - 05:03 PM

Hmm. I couldn't reproduce this problem. 

 

I compiled the code you provided and ran it with valgrind as you did, but no problem was detected:

 

 
==17210== Memcheck, a memory error detector
==17210== Copyright © 2002-2012, and GNU GPL'd, by Julian Seward et al.
==17210== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==17210== Command: ./tutorial
==17210==
I believe!
==17210==
==17210== HEAP SUMMARY:
==17210==     in use at exit: 67,922 bytes in 366 blocks
==17210==   total heap usage: 766 allocs, 400 frees, 90,995 bytes allocated
==17210==
==17210== LEAK SUMMARY:
==17210==    definitely lost: 0 bytes in 0 blocks
==17210==    indirectly lost: 0 bytes in 0 blocks
==17210==      possibly lost: 35 bytes in 1 blocks
==17210==    still reachable: 67,887 bytes in 365 blocks
==17210==         suppressed: 0 bytes in 0 blocks
==17210== Rerun with --leak-check=full to see details of leaked memory
==17210==
==17210== For counts of detected and suppressed errors, rerun with: -v
==17210== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)

PARTNERS