S
spasmous
Yo,
I'm running a subroutine that mallocs a 10 or so Mb, then frees it on
exit. Then when it's called again it mallocs/frees again, and so on
for maybe 100 calls.
Sometimes the code fails after running a long time - is it possible
that malloc needs a contiguous block of memory but my frequent mallocs
have fragged it all up and so the later mallocs fail. Or... am I just
a bad programmer
Thanks for your input.
I'm running a subroutine that mallocs a 10 or so Mb, then frees it on
exit. Then when it's called again it mallocs/frees again, and so on
for maybe 100 calls.
Sometimes the code fails after running a long time - is it possible
that malloc needs a contiguous block of memory but my frequent mallocs
have fragged it all up and so the later mallocs fail. Or... am I just
a bad programmer
Thanks for your input.