Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

"Dynamic Memory Allocation by 'C' for a target (That does not have any Operating System on it)

In 'C', for dynamic allocation, the Borland Compiler allocates memory on the Heap. I want to know, if i am developing  firmware for a target (AM186ER), which does not have any operating system on it, can i use dynamic allocation for that? If, yes then how heap memory allocation is to be taken care into the Firmware?
1 Solution
Usually in firmwares dynamic memory allocation is not encouraged.
If you still want to do it, then you will have to know the memory layout of your firmware.
Also, you should understand how the processor works and manages memory.

The memory allocation heap is not an OS concept.  malloc(), calloc(), and realloc() are
functions in the standard C library.  When running on systems with a modern OS underneath,
these functions typically allocate large chunks of system memory, then parcel it out in small
bits for individual mallocs().  Embedded systems usually provide some or all of the standard
library functions, including malloc() and free().  The embedded environment may require you
to specify a region of memory on the device to be used as the memory allocation heap, either
as a compiler option or at process initialization time.

Does it has any memory manager? since you said it has no OS I presume you don't. In such a case there is no point in dynamic memory allocation, since you would need some thing to manage the memory (memory manager). check what your firmware support.

for more information visit:


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now