Module runtime stdlib

runtime
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
6
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

  • Standard Library

Imported by

Overview

runtime provides access to functions describing the current platform:

  • whether it is 32bit or 64bit
  • how many CPUs/cores are available
  • whether the platform is little endian or big endian
  • etc.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn is_32bit

fn is_32bit() bool

is_32bit returns true if the current executable is running on a 32 bit system.

#fn is_64bit

fn is_64bit() bool

is_64bit returns true if the current executable is running on a 64 bit system.

#fn is_big_endian

fn is_big_endian() bool

is_big_endian returns true if the current executable is running on a big-endian system.

#fn is_little_endian

fn is_little_endian() bool

is_little_endian returns true if the current executable is running on a little-endian system.

#fn nr_cpus

Windows
fn nr_cpus() int

nr_cpus returns the number of virtual CPU cores found on the system.

#fn nr_cpus

Linux
fn nr_cpus() int

nr_cpus returns the number of virtual CPU cores found on the system.

#fn nr_jobs

fn nr_jobs() int

nr_jobs returns the same as nr_cpus with the difference that if an environment variable VJOBS is set, and has a value > 0, then nr_jobs will return that number instead.

This is useful for runtime tweaking of e.g. threaded or concurrent code.

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.