malloc in embedded systems
From: phileo (phileo98_at_yahoo.com)
Date: 02/04/04
- Next message: Clifford Heath: "Re: thanks"
- Previous message: Arthur Richards: "Re: Font for Graphics LCD"
- Next in thread: Richard: "Re: malloc in embedded systems"
- Reply: Richard: "Re: malloc in embedded systems"
- Reply: 42Bastian Schick: "Re: malloc in embedded systems"
- Reply: Thierry Moreau: "Re: malloc in embedded systems"
- Reply: EventHelix.com: "Re: malloc in embedded systems"
- Reply: Emmanuel HERBRETEAU: "Re: malloc in embedded systems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Feb 2004 20:01:06 -0800
I have an embedded system using an RTOS. The one weakness of this
RTOS is that it has a weak memory manager. You can pre-define the
block size that will be created in the memory pool, but this block
size is always fixed. That means that it won't be able to allocate
the exact amount of memory that you need - it will turn out to always
be too much. The only exception to this is if I pre-define the block
size to be the same as the size of my most often used data object.
But I have two different types of data objects (ie. different sizes),
and they are both used often. Soo, I have avoided using this memory
manager, and have been using static arrays instead.
I have a list of data objects that I will need to create during run
time. The number of objects on this list at any given time during
runtime is unknown, although there can a be worst case maximum limit
to the size of this list.
So, my question is this: Which is preferable for my situation,
malloc() or pre-defining a static array that is equal to the worst
case size ?
Thx.
Cheers,
Albert
- Next message: Clifford Heath: "Re: thanks"
- Previous message: Arthur Richards: "Re: Font for Graphics LCD"
- Next in thread: Richard: "Re: malloc in embedded systems"
- Reply: Richard: "Re: malloc in embedded systems"
- Reply: 42Bastian Schick: "Re: malloc in embedded systems"
- Reply: Thierry Moreau: "Re: malloc in embedded systems"
- Reply: EventHelix.com: "Re: malloc in embedded systems"
- Reply: Emmanuel HERBRETEAU: "Re: malloc in embedded systems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|