Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C Valgrind

Name: Anonymous 2012-01-01 20:54

How can this happen?

==2292== HEAP SUMMARY:
==2292==     in use at exit: 0 bytes in 0 blocks
==2292==   total heap usage: 11,384 allocs, 11,341 frees, 270,935,685 bytes allocated
==2292==
==2292== All heap blocks were freed -- no leaks are possible


More allocs than frees but no leaks?

Name: Anonymous 2012-01-01 21:02

This could be possible if the code does malloc(0) or if some allocations fail (return NULL) but Valgrind still reports them.

Name: Anonymous 2012-01-01 21:10

there are no malloc(0) so i guess it's the second one.. I'm in my ram limit, i guess its getting some NULLs.
Thank ya!

Name: Anonymous 2012-01-01 21:41

What about calling free() twice on pointers?
Not a bad bug, just a bug you never hear about.

Name: Anonymous 2012-01-01 21:57

BLAME GCC OPTIMIZATIONS

Name: Anonymous 2012-01-01 21:59

Why should we blame gcc optimizations?

Name: Anonymous 2012-01-01 22:02

>>6
It optimizes anyway any free calls near the end of a program since it knows it'll be returning to the OS anyway which will free any remaining memory

Name: Anonymous 2012-01-01 22:10

/G/ IS DOWN
GET IN HERE /G/ROS!!!

Name: Anonymous 2012-01-01 22:18

>> EVERYTHING IS DOWN, WHAT SHALL WE DO?

Name: Anonymous 2012-01-02 1:50

TEN GET

Name: Anonymous 2012-01-02 1:50

>>10
NICE TEN BUT CHECK MY DUBZ

Name: Anonymous 2012-01-02 2:47

Are there any calls to realloc?

Name: Anonymous 2012-01-02 8:05

>>12
I don't think it would matter.

Name: Anonymous 2012-01-02 8:20

>>13
Why not? It is in my understanding the realloc is likely to allocate but unlikely to call free, and only calls free after a successful allocation.

Name: Anonymous 2012-01-02 11:05

ALLOCATE MY ANUS

Name: Anonymous 2012-01-02 12:23

>>14
The word "free" is a loaded worded in C.

Name: Anonymous 2012-01-02 14:22

>>16
So then how do I overload it

Name: Anonymous 2012-01-02 14:28

>>17
You must use Haskell.

Name: Anonymous 2012-01-02 16:52

>>17
void my_free(void *);
#define free my_free

Don't change these.
Name: Email:
Entire Thread Thread List