Static vs dynamic resource allocation
Wendell Silva
silvawp at gmail.com
Wed Sep 11 17:03:46 UTC 2013
Dears,
I'm creating an API following the same "convention" (ORKID like) as RTEMS
classic API does. That is:
- xxx_initialize()
- xxx_create()
- xxx_ident()
etc.
In the xxx_initialize() function what is better:
a) to use malloc/calloc functions to allocate the object list, limited by
some CONFIGURE_MAXIMUM_XXX macro.
b) to allocate statically the maximum number of objects in vector (of
node lists, for instance).
In case of b), once the library (say libxxx.a) is generated, how the user
can control the maximum number of objects?
Thanks in advance.
--Wendell.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130911/f2231f98/attachment.html>
More information about the devel
mailing list