scala.scalanative.unsafe

Type members

Classlikes

final
class CArray[T, N <: Nat]
sealed abstract
class CFuncPtr
Companion
object
object CFuncPtr
Companion
class
final
class CFuncPtr0[R] extends CFuncPtr
Companion
object
object CFuncPtr0
Companion
class
final
class CFuncPtr1[T1, R] extends CFuncPtr
Companion
object
object CFuncPtr1
Companion
class
final
class CFuncPtr10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] extends CFuncPtr
Companion
object
object CFuncPtr10
Companion
class
final
class CFuncPtr11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] extends CFuncPtr
Companion
object
object CFuncPtr11
Companion
class
final
class CFuncPtr12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] extends CFuncPtr
Companion
object
object CFuncPtr12
Companion
class
final
class CFuncPtr13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] extends CFuncPtr
Companion
object
object CFuncPtr13
Companion
class
final
class CFuncPtr14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] extends CFuncPtr
Companion
object
object CFuncPtr14
Companion
class
final
class CFuncPtr15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] extends CFuncPtr
Companion
object
object CFuncPtr15
Companion
class
final
class CFuncPtr16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] extends CFuncPtr
Companion
object
object CFuncPtr16
Companion
class
final
class CFuncPtr17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] extends CFuncPtr
Companion
object
object CFuncPtr17
Companion
class
final
class CFuncPtr18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] extends CFuncPtr
Companion
object
object CFuncPtr18
Companion
class
final
class CFuncPtr19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] extends CFuncPtr
Companion
object
object CFuncPtr19
Companion
class
final
class CFuncPtr2[T1, T2, R] extends CFuncPtr
Companion
object
object CFuncPtr2
Companion
class
final
class CFuncPtr20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] extends CFuncPtr
Companion
object
object CFuncPtr20
Companion
class
final
class CFuncPtr21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] extends CFuncPtr
Companion
object
object CFuncPtr21
Companion
class
final
class CFuncPtr22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] extends CFuncPtr
Companion
object
object CFuncPtr22
Companion
class
final
class CFuncPtr3[T1, T2, T3, R] extends CFuncPtr
Companion
object
object CFuncPtr3
Companion
class
final
class CFuncPtr4[T1, T2, T3, T4, R] extends CFuncPtr
Companion
object
object CFuncPtr4
Companion
class
final
class CFuncPtr5[T1, T2, T3, T4, T5, R] extends CFuncPtr
Companion
object
object CFuncPtr5
Companion
class
final
class CFuncPtr6[T1, T2, T3, T4, T5, T6, R] extends CFuncPtr
Companion
object
object CFuncPtr6
Companion
class
final
class CFuncPtr7[T1, T2, T3, T4, T5, T6, T7, R] extends CFuncPtr
Companion
object
object CFuncPtr7
Companion
class
final
class CFuncPtr8[T1, T2, T3, T4, T5, T6, T7, T8, R] extends CFuncPtr
Companion
object
object CFuncPtr8
Companion
class
final
class CFuncPtr9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] extends CFuncPtr
Companion
object
object CFuncPtr9
Companion
class
implicit
class CQuote(val ctx: StringContext)

C-style string literal.

C-style string literal.

sealed abstract
class CStruct
final
class CStruct0 extends CStruct
final
class CStruct1[T1] extends CStruct
final
class CStruct10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] extends CStruct
final
class CStruct11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] extends CStruct
final
class CStruct12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] extends CStruct
final
class CStruct13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] extends CStruct
final
class CStruct14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] extends CStruct
final
class CStruct15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] extends CStruct
final
class CStruct16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] extends CStruct
final
class CStruct17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] extends CStruct
final
class CStruct18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] extends CStruct
final
class CStruct19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] extends CStruct
final
class CStruct2[T1, T2] extends CStruct
final
class CStruct20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20] extends CStruct
final
class CStruct21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21] extends CStruct
final
class CStruct22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22] extends CStruct
final
class CStruct3[T1, T2, T3] extends CStruct
final
class CStruct4[T1, T2, T3, T4] extends CStruct
final
class CStruct5[T1, T2, T3, T4, T5] extends CStruct
final
class CStruct6[T1, T2, T3, T4, T5, T6] extends CStruct
final
class CStruct7[T1, T2, T3, T4, T5, T6, T7] extends CStruct
final
class CStruct8[T1, T2, T3, T4, T5, T6, T7, T8] extends CStruct
final
class CStruct9[T1, T2, T3, T4, T5, T6, T7, T8, T9] extends CStruct
final
class CVarArg(val value: Any, val tag: Tag[Any])

Type of a C-style vararg in an extern method.

Type of a C-style vararg in an extern method.

Companion
object
object CVarArg
Companion
class
final

Type of a C-style vararg list (va_list in C).

Type of a C-style vararg list (va_list in C).

Companion
object
Companion
class
sealed abstract
class Nat
Companion
object
object Nat
Companion
class
final
class Ptr[T]
Companion
object
object Ptr
Companion
class
sealed abstract
class Tag[T]
Companion
object
object Tag
Companion
class
final implicit
class UnsafeRichInt(val value: Int) extends AnyVal

Scala Native unsafe extensions to the standard Int.

Scala Native unsafe extensions to the standard Int.

final implicit
class UnsafeRichLong(val value: Long) extends AnyVal

Scala Native unsafe extensions to the standard Long.

Scala Native unsafe extensions to the standard Long.

@implicitNotFound("Given method requires an implicit zone.")
trait Zone

Zone allocator which manages memory allocations.

Zone allocator which manages memory allocations.

Companion
object
object Zone
Companion
class
final
class extern extends StaticAnnotation

An annotation that is used to mark objects that contain externally-defined members

An annotation that is used to mark objects that contain externally-defined members

final
class link(name: String) extends StaticAnnotation

An annotation that is used to automatically link with native library whenever an annotated extern object is used.

An annotation that is used to automatically link with native library whenever an annotated extern object is used.

@field @getter @setter
final
class name(name: String) extends StaticAnnotation

An annotation that is used to refer to differently-named native symbol.

An annotation that is used to refer to differently-named native symbol.

Types

type CBool = Boolean

The C '_Bool' and C++ 'bool' type.

The C '_Bool' and C++ 'bool' type.

type CChar = Byte

The C 'char' type.

The C 'char' type.

The C++ 'char16_t' type.

The C++ 'char16_t' type.

type CChar32 = UInt

The C++ 'char32_t' type.

The C++ 'char32_t' type.

type CDouble = Double

The C 'double' type.

The C 'double' type.

type CFloat = Float

The C 'float' type.

The C 'float' type.

type CInt = Int

The C 'int' type.

The C 'int' type.

type CLong = Word

The C 'long' type.

The C 'long' type.

type CLongInt = Long

The C 'long int' type.

The C 'long int' type.

type CLongLong = Long

The C 'long long' type.

The C 'long long' type.

type CPtrDiff = Long

The C/C++ 'ptrdiff_t' type.

The C/C++ 'ptrdiff_t' type.

type CSSize = Word

The C/C++ 'ssize_t' type.

The C/C++ 'ssize_t' type.

type CShort = Short

The C 'short' type.

The C 'short' type.

type CSignedChar = Byte

The C 'signed char' type.

The C 'signed char' type.

type CSize = UWord

The C/C++ 'size_t' type.

The C/C++ 'size_t' type.

type CString = Ptr[CChar]

C-style string with trailing 0.

C-style string with trailing 0.

The C 'unsigned char' type.

The C 'unsigned char' type.

The C 'unsigned int' type.

The C 'unsigned int' type.

The C 'unsigned long' type.

The C 'unsigned long' type.

The C 'unsigned long int' type.

The C 'unsigned long int' type.

The C 'unsigned long long' type.

The C 'unsigned long long' type.

The C 'unsigned short' type.

The C 'unsigned short' type.

The C++ 'wchar_t' type.

The C++ 'wchar_t' type.

type UWord = ULong

UInt on 32-bit architectures and ULong on 64-bit ones.

UInt on 32-bit architectures and ULong on 64-bit ones.

type Word = Long

Int on 32-bit architectures and Long on 64-bit ones.

Int on 32-bit architectures and Long on 64-bit ones.

Value members

Concrete methods

def alignmentof[T](implicit tag: Tag[T]): CSize

C-style alignment operator.

C-style alignment operator.

def extern: Nothing

Used as right hand side of external method and field declarations.

Used as right hand side of external method and field declarations.

def fromCString(cstr: CString, charset: Charset): String

Convert a CString to a String using given charset.

Convert a CString to a String using given charset.

def fromCWideString(cwstr: CWideString, charset: Charset): String

Convert a CWideString to a String using given charset, assumes platform default wchar_t size

Convert a CWideString to a String using given charset, assumes platform default wchar_t size

def fromCWideString(cwstr: Ptr[CChar16], charset: Charset)(implicit d: DummyImplicit): String

Convert a CWideString based on Ptr[CChar16] to a String using given charset

Convert a CWideString based on Ptr[CChar16] to a String using given charset

def sizeof[T](implicit tag: Tag[T]): CSize

The C 'sizeof' operator.

The C 'sizeof' operator.

def ssizeof[T](implicit tag: Tag[T]): CSSize

The C 'ssizeof' operator.

The C 'ssizeof' operator.

def tagof[T](implicit tag: Tag[T]): Tag[T]

Materialize tag for given type.

Materialize tag for given type.

def toCString(str: String)(implicit z: Zone): CString

Convert a java.lang.String to a CString using default charset and given allocator.

Convert a java.lang.String to a CString using default charset and given allocator.

def toCString(str: String, charset: Charset)(implicit z: Zone): CString

Convert a java.lang.String to a CString using given charset and allocator.

Convert a java.lang.String to a CString using given charset and allocator.

def toCVarArgList()(implicit z: Zone): CVarArgList

Create an empty CVarArgList.

Create an empty CVarArgList.

def toCVarArgList(vararg: CVarArg, varargs: CVarArg*)(implicit z: Zone): CVarArgList

Convert given CVarArgs into a c CVarArgList.

Convert given CVarArgs into a c CVarArgList.

def toCVarArgList(varargs: Seq[CVarArg])(implicit z: Zone): CVarArgList

Convert a sequence of CVarArg into a c CVarArgList.

Convert a sequence of CVarArg into a c CVarArgList.

def toCWideString(str: String, charset: Charset)(implicit z: Zone): Ptr[CWideString]

Convert a java.lang.String to a CWideString using given charset and allocator.

Convert a java.lang.String to a CWideString using given charset and allocator.

def toCWideStringUTF16LE(str: String)(implicit z: Zone): Ptr[CChar16]

Convert a java.lang.String to a CWideString using given UTF-16 LE charset.

Convert a java.lang.String to a CWideString using given UTF-16 LE charset.

Inherited methods

inline
def alloc[T](inline n: CSize)(using tag: Tag[T], zone: Zone): Ptr[T]

Heap allocate and zero-initialize n values using current implicit allocator.

Heap allocate and zero-initialize n values using current implicit allocator.

Inherited from
UnsafePackageCompat
inline
def stackalloc[T](inline n: CSize)(using Tag[T]): Ptr[T]

Stack allocate n values of given type

Stack allocate n values of given type

Inherited from
UnsafePackageCompat

Deprecated and Inherited methods

@deprecated("alloc with signed type is deprecated, convert size to unsigned value", since = "0.4.0")
inline
def alloc[T](inline n: CSSize)(using Tag[T], Zone): Ptr[T]

Heap allocate and zero-initialize n values using current implicit allocator. This method takes argument of type CSSize for easier interop, but it' always converted into CSize

Heap allocate and zero-initialize n values using current implicit allocator. This method takes argument of type CSSize for easier interop, but it' always converted into CSize

Deprecated
[Since version 0.4.0]
Inherited from
UnsafePackageCompat
@deprecated("alloc with signed type is deprecated, convert size to unsigned value", since = "0.4.0")
inline
def stackalloc[T](inline n: CSSize)(using Tag[T]): Ptr[T]

Stack allocate n values of given type.

Stack allocate n values of given type.

Note: unlike alloc, the memory is not zero-initialized. This method takes argument of type CSSize for easier interop, but it's always converted into CSize

Deprecated
[Since version 0.4.0]
Inherited from
UnsafePackageCompat

Implicits

Implicits

final implicit
def CQuote(ctx: StringContext): CQuote

C-style string literal.

C-style string literal.

final implicit
def UnsafeRichInt(value: Int): UnsafeRichInt

Scala Native unsafe extensions to the standard Int.

Scala Native unsafe extensions to the standard Int.

final implicit
def UnsafeRichLong(value: Long): UnsafeRichLong

Scala Native unsafe extensions to the standard Long.

Scala Native unsafe extensions to the standard Long.