Rick C. Hodgin
unread,Aug 13, 2021, 8:38:27 AM8/13/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CAlive Programming Language
CAlive will introduce the ability to reference contiguous data structures through the introduction of the self modifier on pointer members.
The self modifier will specify that the pointer itself does not occupy that space in the structure, but rather it points to data that would be at that space as the type specified.
Example:
struct SDataBlock
{
s32 a;
s32 b;
self s8* ptr;
};
SDataBlock* db;
In the above example, there would be 4 bytes, 4 bytes, and then Nn bytes where the pointer to those Nn bytes is specified as beginning after the preceding 8 bytes.
When allocated, the structure would be 8 bytes in size. When doing pointer math, it would move only by 8 bytes per struct. But the purpose of this feature is not to traverse structures by math, but to process blocks of data readily.
db->ptr would point to the equivalent of &db + 8, and would not be stored in the structure as a pointer value. If passed or used as an operand, it would reference the implied address it refers to. It cannot be an lvalue, however.
--
Rick C. Hodgin