Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2005 13:47:20 +0900
From:      Hajimu UMEMOTO <ume@freebsd.org>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/lib/libc/gen ttyname.c
Message-ID:  <yge64xljdt3.wl%ume@mahoroba.org>
In-Reply-To: <20050515030130.GA63641@crodrigues.org>
References:  <200505141403.j4EE3LYX097762@repoman.freebsd.org> <20050515030130.GA63641@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>>>>> On Sat, 14 May 2005 23:01:30 -0400
>>>>> Craig Rodrigues <rodrigc@crodrigues.org> said:

rodrigc> If you link code with -pthread (and __isthreaded=1), then
rodrigc> in ttyname() in /usr/src/lib/libc/gen/ttyname.c, there
rodrigc> is a malloc() called, but there is no corresponding free().
rodrigc> malloc() is never called if __isthreaded=0.

No, it seems that free() is registered to call when a thread is
finished:

			if (_pthread_key_create(&ttyname_key, free)) {
				_pthread_mutex_unlock(&ttyname_lock);
				return (NULL);
			}

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?yge64xljdt3.wl%ume>