/* Return an allocated memory block back to a Memory Pool.  */
__WEAK uint32_t osRtxMemoryFree(void *mem, void *block)
/* Return an allocated memory block back to a Memory Pool.  */
__WEAK uint32_t osRtxMemoryFree(void *mem, void *block)
{
    EvrRtxMemoryFree(mem, block, 0U);
    return 0U;
  }
  ptr = MemBlockPtr(block, 0U);
  ptr--;
  p_prev = NULL;
  p = MemBlockPtr(mem, sizeof(mem_head_t));
  while (p != ptr) {
    p_prev = p;
    p = p->next;
    if (p == NULL) {
      EvrRtxMemoryFree(mem, block, 0U);
      return 0U;
    }
  }
  (MemHeadPtr(mem))->used -= p->info & MB_INFO_LEN_MASK;
  if (p_prev == NULL) {
    p->info = 0U;
  } else {
    p_prev->next = p->next;
  }
  EvrRtxMemoryFree(mem, block, 1U);
  return 1U;
}