JuliaLang/julia — pull request #2515 by stevengj (2013-03-08 20:25:33+00:00)
Title: RFC: extend unsafe_assign to work for any isbits type, add pointer_from_objref

The attached patch modifies the `pointerset` and `pointerref` intrinsics to check `isbits` rather than `is_bitstype`, so that they use the same code for any pointer-free immutable type.

It also adds a `pointer_from_objref` function which is the inverse of `unsafe_pointer_to_objref`.

Both of these functions are motivated by the desire to be able to store `jl_value_t*` pointers in a C `struct` given a pointer to the latter, as [discussed on julia-dev](https://groups.google.com/forum/?fromgroups=#!topic/julia-dev/Xl9iEWqfFJ4).