TooTallNate/ref-union — pull request #1 by adammw (2012-07-07 13:24:59+00:00)
Title: some more progress on ref-union implementation

Code attached is based on ref-struct implementation, modified to fit union logic.

I think it includes 1 TODO (which can probablly be removed now I think more about it) in the UnionType constructor, and the same `// TODO: optimize - use Buffer#copy()` as in ref-struct in the set function.

Get and set functions that take Buffers are not tested, but the standard field getting/setting is, seems to work but not entirely sure about padding and alignment issues that may arise.
I also noticed that because strings are automatically dereferenced, including a string in a union and accidentally accessing that member without any valid data in the backing Buffer pointer will cause a segfault.