-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVector sometimes allocates #1015
Comments
I believe this is more or less expected, since julia> @code_warntype g()
MethodInstance for g()
from g() in Main at REPL[5]:1
Arguments
#self#::Core.Const(g)
Locals
vl::Int64
Body::Any
1 ─ (vl = Main.length(Main.v))
│ %2 = Core.apply_type(Main.SVector, vl, Main.Int)::Type{SVector{_A, Int64}} where _A
│ %3 = (%2)(Main.v)::Any
└── return %3 |
@fredrikekre thank you for the quick reply. Can you think of any workaround? Any kind of function barrier? |
You can pass around |
@andyferris I still get allocations. Am I missing something? thanks
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This does not allocate
But this allocates:
Using @svector is not an option for me due to #1014
The text was updated successfully, but these errors were encountered: