   @spec registered() :: [atom]
   defdelegate registered(), to: :erlang
 
-  @typep process_flag :: :trap_exit | :error_handler | :min_heap_size |
-                         :min_bin_vheap_size | :priority | :save_calls |
-                         :sensitive
+  @typep heap_size :: non_neg_integer |
+                      %{size: non_neg_integer, kill: boolean, error_logger: boolean}
+
+  @typep priority_level :: :low | :normal | :high | :max
+
   @doc """
   Sets the given `flag` to `value` for the calling process.
 


  See [`:erlang.process_flag/2`](http://www.erlang.org/doc/man/erlang.html#process_flag-2) for more info.

  Inlined by the compiler.
  """
  @spec flag(process_flag, term) :: term
  defdelegate flag(flag, value), to: :erlang, as: :process_flag

  @doc """
  Sets the given `flag` to `value` for the given process `pid`.

  Returns the old value of `flag`.

  The allowed values for `flag` are only a subset of those allowed in `flag/2`,
  namely `:save_calls`.


  Inlined by the compiler.
  """
  @spec flag(pid, :save_calls, 0..10_000) :: 0..10_000
  defdelegate flag(pid, flag, value), to: :erlang, as: :process_flag

  @doc """
