Commit 92563d7a authored by HATAYAMA Daisuke's avatar HATAYAMA Daisuke Committed by Atsushi Kumagai
Browse files

[PATCH 1/2] cache: Allocate buffers at initialization to detect malloc() failure.



malloc() is used in cache_alloc() but there's no check for it. If I
added check in cache_alloc() directly, cache_alloc() needs to return
one more error status and code gets somewhat complicated. Instead, I
move malloc() in initial() to detect allocation failure at
initialization. By this change, 8 buffers are allocated at the same
time, no longer incrementally. However, 8 buffers are almost always
used throughout execution. There's essential differnece from the
incremental one.

Signed-off-by: default avatarHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
parent 6f9b722d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment