Re: free_memory_available()

Jeffrey B. Siegal (papiraki@kdb.ml.org)
Mon, 28 Dec 1998 01:12:35 -0500 (EST)


Hello,

there is a little gap that you did not get. The local variable
avalable is static. This means that it is initialized only once (the first
time the function is called). Usually, local variables reside in the
process's stack (at least in some implementations of c compilers, I don't
know for gcc, but, I'm pretty sure they are). local static variables
reside in the process's data segment along with global variables, the only
diffrence is that other functions don't have a symbol to access them.

The way I see the function, is that available is a flag (like a
boolean) that gets turned on or off. Being static, it keeps it's value
after the function is left for the next time it is needed.

Hope this helps

Papi

PS: I'm not an expert at this, I am (just as you are) in the process of
understanding the implementation.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/