Static allocation

Joel Sherrill joel at rtems.org
Tue Sep 28 15:33:05 UTC 2021


On Tue, Sep 28, 2021, 10:05 AM Петр Борисенко <peter at awsmtek.com> wrote:

> Seems pretty obvious, but I mean kernel. When I define a queue or a task,
> will it compile statically or it will get memory from heap during the
> initialization? @Sebastian Huber <sebastian.huber at embedded-brains.de> mentioned
> that it depends on using of UNLIMITED_OBJECTS configuration option. On
>

Unlimited objects is inherently dynamic memory allocation. It assumes that
there are no hard limits on the number of objects created. Historically,
all Classic API and POSIX API structures were allocated from the RTEMS
Workspace and this lets you dynamically extend the number of objects until
you run out of memory.

Combine it with unified work area and you can allocate until all memory on
your board is consumed.

By wanting static allocation only, you need to use the special task and
queue create APIs for that and avoid services which do dynamic allocation.

--joel

>
> On Tue, Sep 28, 2021, 5:26 PM Joel Sherrill <joel at rtems.org> wrote:
>
>>
>>
>> On Tue, Sep 28, 2021, 6:43 AM Петр Борисенко <peter at awsmtek.com> wrote:
>>
>>> Hello!
>>> Is it possible to compile Rtems statically and disable memory allocation
>>> routines and heap?
>>>
>>
>> No. You have to restrict your application use of APIs and services to
>> those which do not use dynamic allocation.
>>
>> --joel
>>
>>> _______________________________________________
>>> users mailing list
>>> users at rtems.org
>>> http://lists.rtems.org/mailman/listinfo/users
>>>
>>


More information about the users mailing list