]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Introduce malloc_last_fail() which returns the number of seconds since
authorphk <phk@FreeBSD.org>
Fri, 1 Nov 2002 18:58:12 +0000 (18:58 +0000)
committerphk <phk@FreeBSD.org>
Fri, 1 Nov 2002 18:58:12 +0000 (18:58 +0000)
commit27173bd0dd93081098b8676a7b2156fd227c52d3
treeca1df1a49f6cbc6f4cec369bd425e89deaf84e2a
parent3ce3aae31e0179d6c2fec1801690b152f9187cf6
Introduce malloc_last_fail() which returns the number of seconds since
malloc(9) failed last time.  This is intended to help code adjust
memory usage to the current circumstances.

A typical use could be:
if (malloc_last_fail() < 60)
reduce_cache_by_one();
sys/kern/kern_malloc.c
sys/sys/malloc.h