class Intrinsic

namespace sys.core.lang
class Intrinsic

A collection of miscellaneous intrinsic operations and helper functions.

Methods

MemCopy

static def MemCopy(destination: Ptr, source: Ptr, bytes: PtrSize);

Brief

Does a C standard library `memcpy` operation, copying a number of bytes from a source to a destination.

Parameters

destination the destination pointer
source the source pointer
bytes the number of bytes to copy

CStrLen

static def CStrLen(source: Ptr): PtrSize;

Brief

Does a C standard library `strlen` operation, retuning the length of a null terminated C string.

Should not be used on `sys.core.lang.String` since it can contain valid null characters.

Parameters

source the C string

Returns

the length

CpuID

static def CpuID(ref cpu: CArray, val level: Int);

Brief

Executes a CPU identifying set of instructions.

Parameters

cpu the output table
level the level of the requested information

Min

Min(a: T, b: T): T;

Brief

Returns the minimum between two values.


Max

Max(a: T, b: T): T;

Brief

Returns the maximum between two values.


Clamped

Clamped(a: T, min: T, max: T): T;

Brief

Returns the `a` parameter clamped between two values.


Clamp

Clamp(ref a: T, min: T, max: T);

Brief

Clamps the `a` parameter between two values.