Versions Compared

Key

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

Gets the remaining heap memory pool size available to allocate.

Warning

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

Files

lib_mem.h/lib_mem.c

Prototype

CAPTION
Code Block
LanguageC++
CaptionText
languagecpp
          CPU_SIZE_T  Mem_HeapGetSizeRem (CPU_SIZE_T   align,
                                          LIB_ERR     *perr);


Arguments

align

Desired word boundary alignment (in octets) to return remaining memory size from.

...

None.

Example Usage

CAPTION
Code Block
LanguageC++
CaptionText
languagecpp

          void        *pmem_blk;
          CPU_SIZE_T   octets_reqd;
          CPU_SIZE_T   size_rem;
          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) {
              size_rem = Mem_HeapGetSizeRem(4u, &err);
              if (err == LIB_ERR_NONE) {
                  printf("%u more octets available.", size_rem);
              }
          }