GREG> 2)Is there a formula for header size depending on rank?
RAUL> So, expressed in C, it's (7+rank)*sizeof I
There may also be some padding after the s[] shape elements and
before the data values following the header in order to have the
data values properly aligned. (Think of "doubles" requiring 8-byte
alignment, and having such padding always for uniformity reasons.)
This is platform-dependent.
So, while Raul's
(7+rank)*sizeof I
indeed covers all relevant header elements, the offset for the first
data atom might or might not require some rounding up.
As all the London Tubers know: "Mind the gap!"
Martin
PS (aka Padding Space):
This padding space was occasionally an issue back when I made the
J Unix ports. Just very seldom, a test in the test suite would
fail because two arrays wouldn't match (-:) anymore -- when that
padding area wasn't properly initialized. Difficult to reproduce
and debug, back then.
This is also what I *DON'T* like about the use 15!:0 for base
functionalities such as regexes or mmapped files: it pushes APIs
which are portable at the C source level into the J level where the
code working across many platforms gets very, very messy.
(Good luck, Greg!)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm