This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, newlib] Allow locking routine to be retargeted


Hi Freddie,

Thanks for your feedback.

On 10/11/16 15:33, Freddie Chopin wrote:
Hi Thomas!

Why don't you do the same thing for recursive functions? At least the
lock used by malloc() has to be recursive, so with your patch exactly
all mutexes should be recursive too.

Yes, I did not want to expose all functions until there is a need to differentiate. it is easy to add them later but removing it if noone use it would be quite difficult.


I have doubts about practical implementation of these functions for any
RTOS, because of the __LOCK_INIT() macro used for initialization. In
every retargeted function you'll have to start critical section (most
likely by disabling interrupts) to initialize the object on heap, but
then how would you use heap if malloc()'s lock is used via these
functions too?

I do not understand. Why would __LOCK_INIT need to start a critical section?

Best regards,

Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]