use qemu_malloc and friends consistently
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · ----- "malc
Quoted 2 lines · Anthony Liguori
I disagree. The wrong reason we introduced
oom_check()was becausewe
Quoted 1 line
don't trust people to check returns. Why would we trust them to
check
Quoted 1 line
size arguments especially when a lot of programmers are not going
to
Quoted 2 lines
check size arguments by convention?
Quoted 7 lines
Quoted 3 lines
If we really want to fix up code, we can do so in a more benign way.
Instead of aborting, let's return malloc(1) and printf a warning.
Then
Quoted 1 line
we can fix sites without worrying about killing guests.
Printf a warning saying what exactly?
I guess it should say malloc(0) was used with a backtrace to be usefull ...
Quoted 7 lines
Quoted 2 lines
If we only have to fixup a few sites, then yeah, we can switch to
abort(). If it turns out there's a ton of these things and the codeis
Quoted 1 line
uglier, then we can give up and just accept these semantics.
We _already_ use abort, and so far only one caller was caught and taken care of.
I am going to throw in a few more potential cases with my proposed patch. But not that many ...