[Olsr-dev] olsr_malloc()s id parameter
Henning Rogge
(spam-protected)
Tue Sep 2 21:21:52 CEST 2008
On Tue, Sep 2, 2008 at 19:37, Bernd Petrovitsch <(spam-protected)> wrote:
> Another thing (while I'm at it):
>
> olsr_malloc() wants a parameter which is some hint to the place in case
> it fails.
> But since the error handling of "out of memory" errors is always
> "exit()", I see no particular value to know the exact place where the
> failed malloc() happened.
> So we can as well remove that parameter.
No...
> Or does anyone here see any value on that information?
Yes...
first it's a good way to find a memory "leak" (which allocation is
called too often).
Second it's good for getting statistics (which we are not doing at the moment).
In an OOM error it doesn't matter which malloc did it... but if you
just output all mallocs with size and id you get an idea what caused
the problem.
Henning
--
"Wo kämen wir hin, wenn alle sagten, wo kämem wir hin, und niemand
ginge, um einmal zu schauen, wohin man käme, wenn man ginge." (Kurt
Marti)
More information about the Olsr-dev
mailing list