Static vs dynamic resource allocation

Wendell Silva silvawp at
Wed Sep 11 17:03:46 UTC 2013


I'm creating an API following the same "convention" (ORKID like) as RTEMS
classic API does. That is:
  - xxx_initialize()
  - xxx_create()
  - xxx_ident()

In the xxx_initialize() function what is better:
  a) to use malloc/calloc functions to allocate the object list, limited by
  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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the devel mailing list