
354 Embedded systems design
returned. This is a common programming error. In reply, the
calling task receives a pointer that points at the start of the memory
if the call was successful, or an error code if it was not. Very often,
the call is extended to support partial allocation where the system
will still return a pointer to the start of the memory along with an
error/status message stating that not all the memory is available
and that the x bytes were allocated. Some other systems would
class this partial allocation as an error and return an error message
indicating failure.
Memory that was allocated via malloc() calls can be
returned to the memory ...