Package

scala.scalanative

unsafe

Permalink

package unsafe

Linear Supertypes
UnsafePackageCompat, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. unsafe
  2. UnsafePackageCompat
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class CArray[T, N <: Nat] extends AnyRef

    Permalink
  2. type CBool = Boolean

    Permalink

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

  3. type CChar = Byte

    Permalink

    The C 'char' type.

  4. type CChar16 = UShort

    Permalink

    The C++ 'char16_t' type.

  5. type CChar32 = UInt

    Permalink

    The C++ 'char32_t' type.

  6. type CDouble = Double

    Permalink

    The C 'double' type.

  7. type CFloat = Float

    Permalink

    The C 'float' type.

  8. sealed abstract class CFuncPtr extends AnyRef

    Permalink
  9. final class CFuncPtr0[R] extends CFuncPtr

    Permalink
  10. final class CFuncPtr1[T1, R] extends CFuncPtr

    Permalink
  11. final class CFuncPtr10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] extends CFuncPtr

    Permalink
  12. final class CFuncPtr11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] extends CFuncPtr

    Permalink
  13. final class CFuncPtr12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] extends CFuncPtr

    Permalink
  14. final class CFuncPtr13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] extends CFuncPtr

    Permalink
  15. final class CFuncPtr14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] extends CFuncPtr

    Permalink
  16. final class CFuncPtr15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] extends CFuncPtr

    Permalink
  17. final class CFuncPtr16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] extends CFuncPtr

    Permalink
  18. final class CFuncPtr17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] extends CFuncPtr

    Permalink
  19. final class CFuncPtr18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] extends CFuncPtr

    Permalink
  20. 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

    Permalink
  21. final class CFuncPtr2[T1, T2, R] extends CFuncPtr

    Permalink
  22. 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

    Permalink
  23. 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

    Permalink
  24. 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

    Permalink
  25. final class CFuncPtr3[T1, T2, T3, R] extends CFuncPtr

    Permalink
  26. final class CFuncPtr4[T1, T2, T3, T4, R] extends CFuncPtr

    Permalink
  27. final class CFuncPtr5[T1, T2, T3, T4, T5, R] extends CFuncPtr

    Permalink
  28. final class CFuncPtr6[T1, T2, T3, T4, T5, T6, R] extends CFuncPtr

    Permalink
  29. final class CFuncPtr7[T1, T2, T3, T4, T5, T6, T7, R] extends CFuncPtr

    Permalink
  30. final class CFuncPtr8[T1, T2, T3, T4, T5, T6, T7, T8, R] extends CFuncPtr

    Permalink
  31. final class CFuncPtr9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] extends CFuncPtr

    Permalink
  32. type CInt = Int

    Permalink

    The C 'int' type.

  33. type CLong = Long

    Permalink

    The C 'long' type.

  34. type CLongInt = Long

    Permalink

    The C 'long int' type.

  35. type CLongLong = Long

    Permalink

    The C 'long long' type.

  36. type CPtrDiff = Long

    Permalink

    The C/C++ 'ptrdiff_t' type.

  37. implicit class CQuote extends AnyRef

    Permalink

    C-style string literal.

  38. type CSSize = Long

    Permalink

    The C/C++ 'ssize_t' type.

  39. type CShort = Short

    Permalink

    The C 'short' type.

  40. type CSignedChar = Byte

    Permalink

    The C 'signed char' type.

  41. type CSize = ULong

    Permalink

    The C/C++ 'size_t' type.

  42. type CString = Ptr[CChar]

    Permalink

    C-style string with trailing 0.

  43. sealed abstract class CStruct extends AnyRef

    Permalink
  44. final class CStruct0 extends CStruct

    Permalink
  45. final class CStruct1[T1] extends CStruct

    Permalink
  46. final class CStruct10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] extends CStruct

    Permalink
  47. final class CStruct11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] extends CStruct

    Permalink
  48. final class CStruct12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] extends CStruct

    Permalink
  49. final class CStruct13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] extends CStruct

    Permalink
  50. final class CStruct14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] extends CStruct

    Permalink
  51. final class CStruct15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] extends CStruct

    Permalink
  52. final class CStruct16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] extends CStruct

    Permalink
  53. final class CStruct17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] extends CStruct

    Permalink
  54. final class CStruct18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] extends CStruct

    Permalink
  55. final class CStruct19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] extends CStruct

    Permalink
  56. final class CStruct2[T1, T2] extends CStruct

    Permalink
  57. 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

    Permalink
  58. 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

    Permalink
  59. 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

    Permalink
  60. final class CStruct3[T1, T2, T3] extends CStruct

    Permalink
  61. final class CStruct4[T1, T2, T3, T4] extends CStruct

    Permalink
  62. final class CStruct5[T1, T2, T3, T4, T5] extends CStruct

    Permalink
  63. final class CStruct6[T1, T2, T3, T4, T5, T6] extends CStruct

    Permalink
  64. final class CStruct7[T1, T2, T3, T4, T5, T6, T7] extends CStruct

    Permalink
  65. final class CStruct8[T1, T2, T3, T4, T5, T6, T7, T8] extends CStruct

    Permalink
  66. final class CStruct9[T1, T2, T3, T4, T5, T6, T7, T8, T9] extends CStruct

    Permalink
  67. type CUnsignedChar = UByte

    Permalink

    The C 'unsigned char' type.

  68. type CUnsignedInt = UInt

    Permalink

    The C 'unsigned int' type.

  69. type CUnsignedLong = ULong

    Permalink

    The C 'unsigned long' type.

  70. type CUnsignedLongInt = ULong

    Permalink

    The C 'unsigned long int' type.

  71. type CUnsignedLongLong = ULong

    Permalink

    The C 'unsigned long long' type.

  72. type CUnsignedShort = UShort

    Permalink

    The C 'unsigned short' type.

  73. final class CVarArg extends AnyRef

    Permalink

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

  74. final class CVarArgList extends AnyRef

    Permalink

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

  75. type CWideChar = UInt

    Permalink

    The C++ 'wchar_t' type.

  76. type CWideString = Ptr[CWideChar]

    Permalink
  77. sealed abstract class Nat extends AnyRef

    Permalink
  78. final class Ptr[T] extends AnyRef

    Permalink
  79. sealed abstract class Tag[T] extends AnyRef

    Permalink
  80. type UWord = ULong

    Permalink

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

  81. implicit final class UnsafeRichInt extends AnyVal

    Permalink

    Scala Native unsafe extensions to the standard Int.

  82. implicit final class UnsafeRichLong extends AnyVal

    Permalink

    Scala Native unsafe extensions to the standard Long.

  83. type Word = Long

    Permalink

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

  84. trait Zone extends AnyRef

    Permalink

    Zone allocator which manages memory allocations.

    Zone allocator which manages memory allocations.

    Annotations
    @implicitNotFound( ... )
  85. final class extern extends Annotation with StaticAnnotation

    Permalink

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

  86. final class link extends Annotation with StaticAnnotation

    Permalink

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

  87. final class name extends Annotation with StaticAnnotation

    Permalink

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

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

    Annotations
    @field() @getter() @setter()

Value Members

  1. object CFuncPtr

    Permalink
  2. object CFuncPtr0

    Permalink
  3. object CFuncPtr1

    Permalink
  4. object CFuncPtr10

    Permalink
  5. object CFuncPtr11

    Permalink
  6. object CFuncPtr12

    Permalink
  7. object CFuncPtr13

    Permalink
  8. object CFuncPtr14

    Permalink
  9. object CFuncPtr15

    Permalink
  10. object CFuncPtr16

    Permalink
  11. object CFuncPtr17

    Permalink
  12. object CFuncPtr18

    Permalink
  13. object CFuncPtr19

    Permalink
  14. object CFuncPtr2

    Permalink
  15. object CFuncPtr20

    Permalink
  16. object CFuncPtr21

    Permalink
  17. object CFuncPtr22

    Permalink
  18. object CFuncPtr3

    Permalink
  19. object CFuncPtr4

    Permalink
  20. object CFuncPtr5

    Permalink
  21. object CFuncPtr6

    Permalink
  22. object CFuncPtr7

    Permalink
  23. object CFuncPtr8

    Permalink
  24. object CFuncPtr9

    Permalink
  25. object CVarArg

    Permalink
  26. object CVarArgList

    Permalink
  27. object Nat

    Permalink
  28. object Ptr

    Permalink
  29. object Tag

    Permalink
  30. object Zone

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

    Permalink

    C-style alignment operator.

    C-style alignment operator.

    Annotations
    @alwaysinline()
  32. macro def alloc[T](n: CSize)(implicit tag: Tag[T], z: Zone): Ptr[T]

    Permalink

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

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

    Definition Classes
    UnsafePackageCompat
  33. macro def alloc[T]()(implicit tag: Tag[T], z: Zone): Ptr[T]

    Permalink

    Heap allocate and zero-initialize a value using current implicit allocator.

    Heap allocate and zero-initialize a value using current implicit allocator.

    Definition Classes
    UnsafePackageCompat
  34. def extern: Nothing

    Permalink

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

  35. def fromCString(cstr: CString, charset: Charset = Charset.defaultCharset()): String

    Permalink

    Convert a CString to a String using given charset.

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

    Permalink

    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

    Annotations
    @alwaysinline()
  37. def fromCWideString(cwstr: CWideString, charset: Charset): String

    Permalink

    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

    Annotations
    @alwaysinline()
  38. def sizeof[T](implicit tag: Tag[T]): CSize

    Permalink

    The C 'sizeof' operator.

    The C 'sizeof' operator.

    Annotations
    @alwaysinline()
  39. def ssizeof[T](implicit tag: Tag[T]): CSSize

    Permalink

    The C 'ssizeof' operator.

    The C 'ssizeof' operator.

    Annotations
    @alwaysinline()
  40. macro def stackalloc[T](n: CSize)(implicit tag: Tag[T]): Ptr[T]

    Permalink

    Stack allocate n values of given type.

    Stack allocate n values of given type.

    Note: unlike alloc, the memory is not zero-initialized.

    Definition Classes
    UnsafePackageCompat
  41. macro def stackalloc[T]()(implicit tag: Tag[T]): Ptr[T]

    Permalink

    Stack allocate a value of given type.

    Stack allocate a value of given type.

    Note: unlike alloc, the memory is not zero-initialized.

    Definition Classes
    UnsafePackageCompat
  42. def tagof[T](implicit tag: Tag[T]): Tag[T]

    Permalink

    Materialize tag for given type.

    Materialize tag for given type.

    Annotations
    @alwaysinline()
  43. def toCString(str: String, charset: Charset)(implicit z: Zone): CString

    Permalink

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

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

    Permalink

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

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

    Permalink

    Convert a sequence of CVarArg into a c CVarArgList.

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

    Permalink

    Convert given CVarArgs into a c CVarArgList.

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

    Permalink

    Create an empty CVarArgList.

  48. def toCWideString(str: String, charset: Charset = StandardCharsets.UTF_16LE)(implicit z: Zone): Ptr[CWideString]

    Permalink

    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.

    Annotations
    @alwaysinline()
  49. def toCWideStringUTF16LE(str: String)(implicit z: Zone): Ptr[CChar16]

    Permalink

    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.

    Annotations
    @alwaysinline()

Deprecated Value Members

  1. macro def alloc[T](n: CSSize)(implicit tag: Tag[T], z: Zone): Ptr[T]

    Permalink

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

    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

    Definition Classes
    UnsafePackageCompat
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) alloc with signed type is deprecated, convert size to unsigned value

  2. macro def alloc[T](implicit tag: Tag[T], z: Zone): Ptr[T]

    Permalink

    Heap allocate and zero-initialize a value using current implicit allocator.

    Heap allocate and zero-initialize a value using current implicit allocator.

    Definition Classes
    UnsafePackageCompat
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.3) In Scala 3 alloc[T](n) can be confused with alloc[T].apply(n) leading to runtime erros, use alloc[T]() instead

  3. macro def stackalloc[T](n: CSSize)(implicit tag: Tag[T]): Ptr[T]

    Permalink

    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

    Definition Classes
    UnsafePackageCompat
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) alloc with signed type is deprecated, convert size to unsigned value

  4. macro def stackalloc[T](implicit tag: Tag[T]): Ptr[T]

    Permalink

    Stack allocate a value of given type.

    Stack allocate a value of given type.

    Note: unlike alloc, the memory is not zero-initialized.

    Definition Classes
    UnsafePackageCompat
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.3) In Scala 3 alloc[T](n) can be confused with alloc[T].apply(n) leading to runtime erros, use alloc[T]() instead

Inherited from UnsafePackageCompat

Inherited from AnyRef

Inherited from Any

Ungrouped