Core.Builtins
Builtin Function APIs
以下内置函数API被认为是不稳定的,但提供了定义Julia程序能力和行为的基本定义。它们通常通过更高级别的通用API访问。
Core.memoryrefnew — FunctionCore.memoryrefnew(::GenericMemory)
Core.memoryrefnew(::GenericMemoryRef, index::Int, [boundscheck::Bool])返回一个 GenericMemoryRef 用于 GenericMemory。请参见 memoryref。
此函数需要 Julia 1.11 或更高版本。
Core.memoryrefoffset — FunctionCore..memoryrefoffset(::GenericMemoryRef)返回用于构造 MemoryRef 的偏移索引。请参见 memoryref。
此函数需要 Julia 1.11 或更高版本。
Core.memoryrefget — FunctionCore.memoryrefget(::GenericMemoryRef, ordering::Symbol, boundscheck::Bool)返回存储在 MemoryRef 中的值,如果 Memory 为空则抛出 BoundsError。参见 ref[]。指定的内存顺序必须与 isatomic 参数兼容。
此函数需要 Julia 1.11 或更高版本。
Core.memoryrefset! — FunctionCore.memoryrefset!(::GenericMemoryRef, value, ordering::Symbol, boundscheck::Bool)将值存储到 MemoryRef,如果 Memory 为空则抛出 BoundsError。参见 ref[] = value。指定的内存顺序必须与 isatomic 参数兼容。
此函数需要 Julia 1.11 或更高版本。
Core.memoryref_isassigned — FunctionCore.memoryref_isassigned(::GenericMemoryRef, ordering::Symbol, boundscheck::Bool)返回 MemoryRef 中是否存储了值,如果 Memory 为空则返回 false。请参见 isassigned(::Base.RefValue),Core.memoryrefget。指定的内存顺序必须与 isatomic 参数兼容。
此函数需要 Julia 1.11 或更高版本。
Core.memoryrefswap! — FunctionCore.memoryrefswap!(::GenericMemoryRef, value, ordering::Symbol, boundscheck::Bool)原子性地执行操作,同时获取和设置 MemoryRef 值。
此函数需要 Julia 1.11 或更高版本。
另请参见 swapproperty! 和 Core.memoryrefset!.
Core.memoryrefmodify! — FunctionCore.memoryrefmodify!(::GenericMemoryRef, op, value, ordering::Symbol, boundscheck::Bool) -> Pair原子地执行操作以获取和设置 MemoryRef 值,应用函数 op 后。
此函数需要 Julia 1.11 或更高版本。
另请参见 modifyproperty! 和 Core.memoryrefset!.
Core.memoryrefreplace! — FunctionCore.memoryrefreplace!(::GenericMemoryRef, expected, desired,
success_order::Symbol, fail_order::Symbol=success_order, boundscheck::Bool) -> (; old, success::Bool)原子地执行获取和有条件设置 MemoryRef 值的操作。
此函数需要 Julia 1.11 或更高版本。
另请参见 replaceproperty! 和 Core.memoryrefset!。
Core.memoryrefsetonce! — FunctionCore.memoryrefsetonce!(::GenericMemoryRef, value,
success_order::Symbol, fail_order::Symbol=success_order, boundscheck::Bool) -> success::Bool原子性地执行操作,将 MemoryRef 设置为给定值,仅在之前未设置的情况下。
此函数需要 Julia 1.11 或更高版本。
另请参见 setpropertyonce! 和 Core.memoryrefset!。
Core.Intrinsics.atomic_pointerref — FunctionCore.Intrinsics.atomic_pointerref(pointer::Ptr{T}, order::Symbol) --> T此函数需要 Julia 1.7 或更高版本。
请参见 unsafe_load.
Core.Intrinsics.atomic_pointerset — FunctionCore.Intrinsics.atomic_pointerset(pointer::Ptr{T}, new::T, order::Symbol) --> pointer此函数需要 Julia 1.7 或更高版本。
请参见 unsafe_store!。
Core.Intrinsics.atomic_pointerswap — FunctionCore.Intrinsics.atomic_pointerswap(pointer::Ptr{T}, new::T, order::Symbol) --> old此函数需要 Julia 1.7 或更高版本。
请参见 unsafe_swap!。
Core.Intrinsics.atomic_pointermodify — FunctionCore.Intrinsics.atomic_pointermodify(pointer::Ptr{T}, function::(old::T,arg::S)->T, arg::S, order::Symbol) --> old此函数需要 Julia 1.7 或更高版本。
请参见 unsafe_modify!。
Core.Intrinsics.atomic_pointerreplace — FunctionCore.Intrinsics.atomic_pointerreplace(pointer::Ptr{T}, expected::Any, new::T, success_order::Symbol, failure_order::Symbol) --> (old, cmp)此函数需要 Julia 1.7 或更高版本。
请参见 unsafe_replace!。
Core.get_binding_type — FunctionCore.get_binding_type(module::Module, name::Symbol)从模块 module 中检索绑定 name 的声明类型。
此函数需要 Julia 1.9 或更高版本。
Core.set_binding_type! — FunctionCore.set_binding_type!(module::Module, name::Symbol, [type::Type])将模块 module 中绑定 name 的声明类型设置为 type。如果该绑定已经具有与 type 不相等的类型,则会报错。如果 type 参数缺失,则在未设置的情况下将绑定类型设置为 Any,但不会报错。
此函数需要 Julia 1.9 或更高版本。
Core.IntrinsicFunction — TypeCore.IntrinsicFunction <: Core.Builtin <: FunctionCore.IntrinsicFunction 函数定义了一些基本原语,这些原语定义了 Julia 程序的能力和行为。
Core.Intrinsics — ModuleCore.IntrinsicsCore.Intrinsics 模块包含 Core.IntrinsicFunction 对象。
Core.IR — ModuleCore.IRCore.IR 模块导出了 IR 对象模型。