lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] memory pools question


From: Simon Goldschmidt
Subject: Re: [lwip-users] memory pools question
Date: Thu, 26 Jan 2012 15:08:56 +0100

jblackarty <address@hidden> wrote:
> The only thing remained in a shadow is combination MEM_USE_POOLS +
> MEMP_USE_CUSTOM_POOLS. As I understand MEMP_USE_CUSTOM_POOLS have only
> one exclusive dependency on MEM_USE_POOLS. Also you said directly that
> user have to enable second one if enables first one. Why not remove
> this redundant option ? They have equal meaning. Or maybe it's
> possible to have MEMP_USE_CUSTOM_POOLS enabled without MEM_USE_POOLS ?

Exactly. For example, your port can create custom pools to put semaphores or 
mboxes in it and allocate from that pool when calling sys_sem_new().

> This married couple has another issue I asked about in thread "System
> objects management (semaphores, mailboxes, mutexes, threads, etc.): pool size
> ?"
> To use MEMP pool efficiently in sys_arch I need to know a kind of mailbox
> in
> sys_mbox_new() rather then size. I cannot reverse-determine kind from
> size, because sizes are not different generally. At the same time,
> pool-based mem_malloc won't help in case when mailbox itself allocated
> in RTOS memory and RTOS return just pointer (sys_mbox_t) of fixed
> size. In such a way, I have to implement own independed pool mechanism
> included
> in port for that RTOS.

I don't think I have thought that through fully, but mboxes are only created in 
5 different sizes (at maximum), so it shouldn't be too hard to switch over mbox 
size to know the pool to allocate from?

Simon
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



reply via email to

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