very interesting simple cache management

this commit is for comments on cache.c

cache.c implements a simple cache working like stack, all operations
work on the top. This stack-like cache can provide
cache_alloc/cache_free in O(1), VERY PERFORMANT.

1. if no cached item, just malloc it. The item can't be stashed into
cache until it's freed by up caller.
2. cache_free is simple, just stash the item into cache and maintain
freecurr, which is top record of stack.
3. this cache is self-adopted, it can enlarge itself if it can't hold
freetotal items. When enlarging, it use realloc but not malloc or
calloc. Very good choice, avoiding freeing old memory and copying data
from old memory to new one.

This is a very good cache implementation. If I am the one who designes
such a cache, I'd add one more entry in cache_t, which might be an
array, to indicate each cache item is free or not. But if doing this,
cache_alloc/_free will then become O(N), which is much worse then O(1).

Well, I like O(N), but who can say no to O(1). :-)....

It's a good day!