Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jul 2005 00:09:17 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Roman Kurakin <rik@cronyx.ru>
Cc:        freebsd-hackers@FreeBSD.org, Dmitry Mityugov <dmitry.mityugov@gmail.com>
Subject:   Re: Malloc while freeing some object
Message-ID:  <20050630210917.GB685@gothmog.gr>
In-Reply-To: <42C4398C.5060808@cronyx.ru>
References:  <42C424EA.70306@cronyx.ru> <b7052e1e050630110261e94f22@mail.gmail.com> <42C4398C.5060808@cronyx.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-06-30 22:27, Roman Kurakin <rik@cronyx.ru> wrote:
>Dmitry Mityugov wrote:
>>On 6/30/05, Roman Kurakin <rik@cronyx.ru> wrote:
>>> 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.

Not necessarily.  This could be a problem if you are implementing the
allocator itself, and start an infinite recursion or end up deadlocking
against the allocator which waits the allocator to finish, which waits
the allocator... etc.

Users of a general purpose memory allocator don't generally have to
worry about the same thing though ;-)




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