-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2468 from stevengj/pointerany
RFC: add unsafe_pointer_to_any (fixes #2458)
- Loading branch information
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1126,6 +1126,7 @@ export | |
strerror, | ||
unsafe_ref, | ||
unsafe_assign, | ||
unsafe_pointer_to_any, | ||
|
||
# Macros | ||
@str, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,9 @@ unsafe_assign(p::Ptr{Any}, x::ANY, i::Integer) = pointerset(p, x, int(i)) | |
unsafe_assign{T}(p::Ptr{T}, x, i::Integer) = pointerset(p, convert(T, x), int(i)) | ||
unsafe_assign{T}(p::Ptr{T}, x) = unsafe_assign(p, convert(T,x), 1) | ||
|
||
# convert a boxed jl_value_t* to Any | ||
unsafe_pointer_to_any(p::Ptr) = pointerany(p) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JeffBezanson
Author
Member
|
||
|
||
integer(x::Ptr) = convert(Uint, x) | ||
unsigned(x::Ptr) = convert(Uint, x) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
does this need to be added to inference.jl also?