
  -spec process_info(Pid) -> Info
                        when
                            Pid :: pid(),
                            Info :: [InfoTuple] | undefined,
                            InfoTuple :: process_info_result_item().

  Types:
    -type max_heap_size() ::
          Size ::
              non_neg_integer() |
              #{size => non_neg_integer(),
                kill => boolean(),
                error_logger => boolean()}.
    -type message_queue_data() :: off_heap | on_heap.
    -type priority_level() :: low | normal | high | max.
    -type process_info_result_item() ::
          {backtrace, Bin :: binary()} |
          {binary,
           BinInfo ::
               [{non_neg_integer(),
                 non_neg_integer(),
                 non_neg_integer()}]} |
          {catchlevel, CatchLevel :: non_neg_integer()} |
          {current_function,
           {Module :: module(), Function :: atom(), Arity :: arity()} |
           undefined} |
          {current_location,
           {Module :: module(),
            Function :: atom(),
            Arity :: arity(),
            Location ::
                [{file, Filename :: string()} |
                 {line, Line :: pos_integer()}]}} |
          {current_stacktrace, Stack :: [stack_item()]} |
          {dictionary, Dictionary :: [{Key :: term(), Value :: term()}]} |
          {error_handler, Module :: module()} |
          {garbage_collection, GCInfo :: [{atom(), non_neg_integer()}]} |
          {garbage_collection_info,
           GCInfo :: [{atom(), non_neg_integer()}]} |
          {group_leader, GroupLeader :: pid()} |
          {heap_size, Size :: non_neg_integer()} |
          {initial_call, mfa()} |
          {links, PidsAndPorts :: [pid() | port()]} |
          {last_calls, false | (Calls :: [mfa()])} |
          {memory, Size :: non_neg_integer()} |
          {message_queue_len, MessageQueueLen :: non_neg_integer()} |
          {messages, MessageQueue :: [term()]} |
          {min_heap_size, MinHeapSize :: non_neg_integer()} |
          {min_bin_vheap_size, MinBinVHeapSize :: non_neg_integer()} |
          {max_heap_size, MaxHeapSize :: max_heap_size()} |
          {monitored_by,
           MonitoredBy :: [pid() | port() | nif_resource()]} |
          {monitors,
           Monitors ::
               [{process | port,
                 Pid ::
                     pid() |
                     port() |
                     {RegName :: atom(), Node :: node()}}]} |
          {message_queue_data, MQD :: message_queue_data()} |
          {priority, Level :: priority_level()} |
          {reductions, Number :: non_neg_integer()} |
          {registered_name, [] | (Atom :: atom())} |
          {sequential_trace_token,
           [] | (SequentialTraceToken :: term())} |
          {stack_size, Size :: non_neg_integer()} |
          {status,
           Status ::
               exiting | garbage_collecting | waiting | running |
               runnable | suspended} |
          {suspending,
           SuspendeeList ::
               [{Suspendee :: pid(),
                 ActiveSuspendCount :: non_neg_integer(),
                 OutstandingSuspendCount :: non_neg_integer()}]} |
          {total_heap_size, Size :: non_neg_integer()} |
          {trace, InternalTraceFlags :: non_neg_integer()} |
          {trap_exit, Boolean :: boolean()}.
    -type stack_item() ::
          {Module :: module(),
           Function :: atom(),
           Arity :: arity() | (Args :: [term()]),
           Location ::
               [{file, Filename :: string()} |
                {line, Line :: pos_integer()}]}.

  Returns a list containing InfoTuples with miscellaneous
  information about the process identified by Pid, or undefined
  if the process is not alive.

  The order of the InfoTuples is undefined and all InfoTuples
  are not mandatory. The InfoTuples part of the result can be
  changed without prior notice.

  The InfoTuples with the following items are part of the result:

   • current_function

   • initial_call

   • status

   • message_queue_len

   • links

   • dictionary

   • trap_exit

   • error_handler

   • priority

   • group_leader

   • total_heap_size

   • heap_size

   • stack_size

   • reductions

   • garbage_collection

  If the process identified by Pid has a registered name, also an 
  InfoTuple with item registered_name is included.

  For information about specific InfoTuples, see process_info/2.

  Warning:
    This BIF is intended for debugging only. For all other
    purposes, use process_info/2.

  Failure: badarg if Pid is not a local process.
