Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Gets a single memory block from the heap.

Warning

This function is deprecated and will be removed in a future version of this product.

...

.

Files

lib_mem.h/lib_mem.c

Prototype

Code Block
languagecpp
void  *Mem_HeapAlloc (CPU_SIZE_T   size,
                      CPU_SIZE_T   align,
                      CPU_SIZE_T  *poctets_reqd,
                      LIB_ERR     *perr);


Arguments

size

Size of requested memory block (in octets).

...

None.

Example Usage

C++
Code Block
Language
CaptionTextCAPTION
languagecpp
          void        *pmem_blk;
          CPU_SIZE_T   octets_reqd;
          LIB_ERR      err;


                    pmem_blk = Mem_HeapAlloc((CPU_SIZE_T) 100u,
                                   (CPU_SIZE_T)   4u,
                                   (CPU_SIZE_T)&octets_reqd,
                                   (LIB_ERR  *)&err);
           
          if (err != LIB_ERR_NONE) {
              printf("COULD NOT GET MEMORY BLOCK FROM HEAP.");
          }