crystal-book icon indicating copy to clipboard operation
crystal-book copied to clipboard

Inaccuracies in the `Struct` page

Open Archivist062 opened this issue 4 years ago • 1 comments

The Struct page reads as follow:

The second point has a reason to it: a struct has a very well defined memory layout.

This may be very misleading as there is very few pieces of information on Crystal memory layout.

I would propose to add or modify the text to a content more on the idea of:

packed structs have a well defined layout, struct have a layout that is well defined within each platform, following the C layout for a struct on the same platform when relevant

Archivist062 avatar Jun 25 '20 12:06 Archivist062

Tangentially, it would be great to have references to Crystal's memory model - even if yellow-taped as unstable - for those of us writing memory-sensitive applications today. crystal tool hierarchy has been very helpful, but the layout and cost of unions for example has been difficult to discover.

z64 avatar Jun 29 '20 15:06 z64