Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Jun 24, 2019

No description provided.

isbitsunion(u::Union) = (@_pure_meta; ccall(:jl_array_store_unboxed, Cint, (Any,), u) != Cint(0))
isbitsunion(x) = false

isptrelement(t::Type) = (@_pure_meta; ccall(:jl_array_store_unboxed, Cint, (Any,), t) == Cint(0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already define this here, so maybe we should consolidate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not quite the same, since the other query is related to this query by the formula isbitsunion(u) = u isa Union && isptrelement(u)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right; I was mainly pointing out that maybe we should define a single ccall definition for this (and have isbitsunion call that), just to minimize the need to update things in two places if jl_array_store_unboxed ever changes.

@JeffBezanson JeffBezanson changed the title RFC: arrayunset: micro-optimization for performance arrayunset: micro-optimization for performance Jun 26, 2019
@JeffBezanson JeffBezanson merged commit 6f5cefb into master Jun 26, 2019
@JeffBezanson JeffBezanson deleted the jn/arrayunset-perf branch June 26, 2019 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants