Try scrypt.
gonerogue's Content
There have been 4 items by gonerogue (Search limited from 20-January 20)
By content type
See this member's
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download
There have been 4 items by gonerogue (Search limited from 20-January 20)
Posted by
gonerogue
on 27 October 2014 - 06:11 AM
in
PHP Tutorials
Try scrypt.
Posted by
gonerogue
on 16 April 2014 - 09:10 PM
in
The Lounge
Good luck !
Posted by
gonerogue
on 21 February 2014 - 04:49 AM
in
Classes and Code Snippets
Yes, you do have memory leaks.
Is good to run the program under a runtime analysis tool to see this kind of problems.
I have run your program under valgrind, here is the report:
$ valgrind --leak-check=full ./test ==1791== Memcheck, a memory error detector ==1791== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==1791== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==1791== Command: ./test ==1791== How many children are in the circle -- must be > 0: 100 Remove every nth child -- value for n must be > 0: 4 Computing the answer... Child number 34 is the winner.==1791== ==1791== HEAP SUMMARY: ==1791== in use at exit: 40 bytes in 5 blocks ==1791== total heap usage: 104 allocs, 99 frees, 832 bytes allocated ==1791== ==1791== 8 bytes in 1 blocks are definitely lost in loss record 1 of 5 ==1791== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==1791== by 0x80484C5: findSolution (test.c:11) ==1791== by 0x80486E3: main (test.c:87) ==1791== ==1791== 8 bytes in 1 blocks are definitely lost in loss record 2 of 5 ==1791== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==1791== by 0x80484D4: findSolution (test.c:12) ==1791== by 0x80486E3: main (test.c:87) ==1791== ==1791== 8 bytes in 1 blocks are definitely lost in loss record 3 of 5 ==1791== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==1791== by 0x80484E3: findSolution (test.c:13) ==1791== by 0x80486E3: main (test.c:87) ==1791== ==1791== 8 bytes in 1 blocks are definitely lost in loss record 4 of 5 ==1791== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==1791== by 0x80484F2: findSolution (test.c:14) ==1791== by 0x80486E3: main (test.c:87) ==1791== ==1791== 8 bytes in 1 blocks are definitely lost in loss record 5 of 5 ==1791== at 0x4023F50: malloc (vg_replace_malloc.c:236) ==1791== by 0x8048521: findSolution (test.c:24) ==1791== by 0x80486E3: main (test.c:87) ==1791== ==1791== LEAK SUMMARY: ==1791== definitely lost: 40 bytes in 5 blocks ==1791== indirectly lost: 0 bytes in 0 blocks ==1791== possibly lost: 0 bytes in 0 blocks ==1791== still reachable: 0 bytes in 0 blocks ==1791== suppressed: 0 bytes in 0 blocks ==1791== ==1791== For counts of detected and suppressed errors, rerun with: -v ==1791== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 13 from 8)
Posted by
gonerogue
on 04 February 2014 - 08:30 AM
in
Projects and Site Reviews
Awesome !