You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
I am trying to see if I could fix some file serialization problems.
Suppose I have a composite type
type Foo
a::Int64
end
foo = Foo(10)
How do I get the memory address or location of foo?
Tim Holy
unread,
Apr 20, 2014, 6:29:16 AM4/20/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
You can use pointer(foo).
However, note that Julia has the "a===b" comparsion (which maps to "is(a,b)"),
which evaluates to true only if a and b refer to the same object.
--Tim
Freddy Chua
unread,
Apr 20, 2014, 6:47:39 AM4/20/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
Found
pointer_from_objref
Thanks! I am trying to fix HDF5 using this!
Steven G. Johnson
unread,
Apr 21, 2014, 1:54:25 PM4/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
On Sunday, April 20, 2014 6:47:39 AM UTC-4, Freddy Chua wrote:
Found
pointer_from_objref
Thanks! I am trying to fix HDF5 using this!
Note that this will give a pointer to an internal Julia data structure (although this may change: https://github.com/JuliaLang/julia/pull/2818), which is probably not what you want for serialization.
If you have an Array whose elements are an immutable type, that should serialize nicely (since its memory layout is identical to the analogous C array of structs).