From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 30 18:33:06 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A90B716A41C for ; Thu, 30 Jun 2005 18:33:06 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FC7043D48 for ; Thu, 30 Jun 2005 18:33:05 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru (8.13.0/vak/3.0) id j5UIU4VE008966 for freebsd-hackers@freebsd.org.checked; Thu, 30 Jun 2005 22:30:04 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from [144.206.181.94] (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru (8.13.0/vak/3.0) with ESMTP id j5UIRJ1s008938; Thu, 30 Jun 2005 22:27:19 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <42C4398C.5060808@cronyx.ru> Date: Thu, 30 Jun 2005 22:27:24 +0400 From: Roman Kurakin User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Mityugov References: <42C424EA.70306@cronyx.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Malloc while freeing some object X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 18:33:06 -0000 Dmitry Mityugov wrote: >On 6/30/05, Roman Kurakin wrote: > > >>Hi, >> >> One simple question on programming style. Is it ok >>to call malloc while we releasing some object? >> >> >Are you releasing it in another thread? Is it a C++ object? How are > >you releasing it? > > This was general question. In fact I've found that ttyfree() function from kernel code allocates tempory variables to free tty. I didn't expect such behaviour. I always thought that deallocation of smth should need other alloc. rik