let get_scoped shared =
  function
    | ScopeGlobal -> shared.global
    | ScopeProcess -> shared.process