Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Redundant union members in IoObject_struct.h #197

kmag opened this Issue · 5 comments

4 participants


Currently in head in

IoObjectData contains:

void *ptr;
void *ptr2;
} pointers;
double d;
uint32_t ui32;
} data; // 8 bytes (9+8 = 17)

ptr and ptr2 have the same type and occupy the same space. The names seem to imply the intention was to use them as a cons cell, or at least be able to use both ptr and ptr simultaneously.

On #io today, jer had a look and it doesn't appear that IoObject_dataPointer2 is used anywhere. ptr2 should probably be removed along with pointers, and ptr placed directly in data. There's no performance or space savings, but it gets rid of a potential source of subtle bugs.


On a side note, the comments counting the bytes in the struct look non-sensical.


I agree with this statement entirely. And can confirm that ptr2 (and the associated macros IoObject_dataPointer2 and IoObject_setDataPointer2) are not used anywhere in the codebase.

If there are no objections, I'll pull these out and submit the match.


Sounds good - don't recall what that was about. :)


I've submitted the pull request (#199).


Nice catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.