Skip site navigation (1)Skip section navigation (2)
Date:      19 Jul 1999 18:06:37 +0200
From:      Dag-Erling Smorgrav <des@flood.ping.uio.no>
To:        "Kelly Yancey" <kbyanc@alcnet.com>
Cc:        <hackers@FreeBSD.ORG>
Subject:   Re: Overcommit and calloc()
Message-ID:  <xzp3dykmxo2.fsf@flood.ping.uio.no>
In-Reply-To: "Kelly Yancey"'s message of "Mon, 19 Jul 1999 11:54:05 -0400"
References:  <001501bed1fe$edf66980$291c453f@kbyanc.alcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Kelly Yancey" <kbyanc@alcnet.com> writes:
>   I'm afraid my question got lost amongst the see of overcommit messages. :)
>   I was curious if calloc() was overcommitted also?

Here's our calloc() implementation:

void *
calloc(num, size)
	size_t num;
	register size_t size;
{
	register void *p;

	size *= num;
	if ( (p = malloc(size)) )
		bzero(p, size);
	return(p);
}

so the answer is yes, it overcommits, but the bzero() may cause the
system to run out of swap.

DES
-- 
Dag-Erling Smorgrav - des@flood.ping.uio.no


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp3dykmxo2.fsf>