avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] making malloc() and free() reentrant safe


From: Russell Shaw
Subject: Re: [avr-libc-dev] making malloc() and free() reentrant safe
Date: Thu, 30 Jun 2005 10:54:53 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1

Joerg Wunsch wrote:
As Branislav Katreniak wrote:

I want to use a multitasking OS in my project. What is the best way
to encapsulate all calls to malloc() and free() with a
synchronization primitives? I want all calls to these functions
(even from other libc functions) to be reentrant safe and ideally
I'd like to use official libc library without any modifications.

First, if you don't use stdio (or only use sprintf without
floating-point), the library doesn't use malloc() itself, so it would
suffice to wrap malloc() and free() in your own macros.

If you need stdio functions that call malloc, hmm, I think that'll put
something else onto your list of non-reentrant functions ;-), but
still, you could just import the implementations for malloc/free into
your own application, and make them thread-safe.

What stdio functions call malloc?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]