Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They are not guaranteed to be contiguous, but they supposedly are if you specify a primative type and initialize them all at once. Tuples have a constant size, are contiguous, and immutable. So lots of optimization opportunity.


It is guaranteed to be contiguous. It might be an array of pointers if you put heap allocated objects in there (like an array of arrays). I think what you instead meant to say is that it's not guaranteed to be stored inline, which yes it is the case that it's only able to be stored inline if `Base.isbits(eltype(A))`, i.e. if it can deduce the bit length of the element type as constant and the objects are allocated to the stack. But of course that's just a requirement for storing values in an array even in C(++) (nice description here: https://stackoverflow.com/a/54654958/1544203), it's just a basic requirement due to having to know the memory size of what is being stored, and so it's not necessarily a limitation of Julia but of all languages.


How is it an array if it's not guaranteed to be contiguous?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: