Skip to content

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Dec 9, 2024

I don't know if you think this is useful too.

I think it is useful for a couple of different applications:

  • Some object oriented / generic features are implemented by using field
    offsets (e.g. container_of like in the Linux kernel).
  • Tracking extra allocation data, this is where the first "offsetof()"
    feature request comes from: https://bugs.php.net/bug.php?id=79066
  • Serialization/deserialization purposes with direct pointer arithmetic

Would resolve https://bugs.php.net/bug.php?id=79066

This is useful for a couple of different applications:
- Some object oriented / generic features are implemented by using field
  offsets (e.g. container_of like in the Linux kernel).
- Tracking extra allocation data, this is where the first "offsetof()"
  feature request comes from: https://bugs.php.net/bug.php?id=79066
- Serialization/deserialization purposes with direct pointer arithmetic
@nielsdos
Copy link
Member Author

nielsdos commented Dec 9, 2024

Technically already possible with getStructFieldOffset... but I missed this

@nielsdos nielsdos closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant