From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4B0180A6.80207@domain.hid> Date: Mon, 16 Nov 2009 17:41:10 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4B01792A.4090206@domain.hid> <4B017F7A.4090409@domain.hid> In-Reply-To: <4B017F7A.4090409@domain.hid> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-core] [Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai-core Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> GIT version control wrote: >>> +void xnheap_set_label(xnheap_t *heap, const char *label, ...) >>> +{ >>> + va_list args; >>> + spl_t s; >>> + >>> + va_start(args, label); >>> + >>> + xnlock_get_irqsave(&nklock, s); >>> + vsnprintf(heap->label, sizeof(heap->label), label, args); >>> + xnlock_put_irqrestore(&nklock, s); >> Why do we need locking here ? >> > > We already registered the heap, so I want to avoid that someone dumping > /proc sees an inconsistent string - or even an unterminated one. There are other ways to avoid that, but, I am over-reacting to printf. But it is not really a printf, it is an snprintf, which is not that heavy. -- Gilles