Skip to content

Document CStruct vs CStructEntity #40

@chrisseaton

Description

@chrisseaton

I understand what CStructEntity is - it's a subclass of pointer that points to an instance of the structure in memory.

I don't really understand what CStruct is. It's an object that has a method that returns that subclass of pointer that you want to instantiate. Why not just pass the subclass of pointer in? Why have this entity_class indirection?

Could we write Fiddle::CStructBuilder.create(CUnion, types, members) instead of Fiddle::CStructBuilder.create(Fiddle::CUnion, types, members)?

I know about backwards compatibility concerns, but I don't understand the original intention behind this, and it isn't documented, and even as an FFI and Ruby expert I find it extremely confusing.

I also wish CStructEntity was CStructPointer, but again backwards compatibility I guess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions