/* Create a new stack instance with given stack size. */
REDFISH_STACK* NewRedfishStack(IN UINTN StackSize)
/* Create a new stack instance with given stack size. */
REDFISH_STACK* NewRedfishStack(IN UINTN StackSize)
{
  REDFISH_STACK  *Buffer;
  if (StackSize == 0) {
    return NULL;
  }
  Buffer = AllocateZeroPool (sizeof (REDFISH_STACK));
  if (Buffer == NULL) {
    return NULL;
  }
  Buffer->Pool = AllocateZeroPool (sizeof (VOID *) * StackSize);
  if (Buffer->Pool == NULL) {
    FreePool (Buffer);
    return NULL;
  }
  Buffer->Size  = StackSize;
  Buffer->Index = 0;
  return Buffer;
}