>
> Does this mean `Ptr{UInt32}(1000)`  does not alloc any memory?
>

No, in the code_llvm output, the address is received as argument `%0` and
passed to the `load` pseudo-instruction.

The call means "load a UInt32 from address 1000". Please do have a look at
the documentation:

help?> unsafe_load
> search: unsafe_load
>   unsafe_load(p::Ptr{T},i::Integer)
>   Load a value of type T from the address of the ith element (1-indexed)
> starting at p. This is equivalent to the C expression p[i-1].
>   The unsafe prefix on this function indicates that no validation is
> performed on the pointer p to ensure that it is valid. Incorrect
>   usage may segfault your program or return garbage answers, in the same
> manner as C.


On Tue, Jan 26, 2016 at 8:13 PM, Bryan Rivera <[email protected]>
wrote:

> julia> @code_llvm unsafe_load( Ptr{UInt32}(1000) )
>
> define i32 @julia_unsafe_load_21205(i32*) {
> top:
>   %1 = load i32* %0, align 1
>   ret i32 %1
> }
>
>
> Does this mean `Ptr{UInt32}(1000)`  does not alloc any memory?
>
> What effect does the 1000 have?
>

Reply via email to