New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified compiler to allow dynamic arrays within structs #164
Modified compiler to allow dynamic arrays within structs #164
Conversation
Umm... can you keep the spacing the same? I know, I know, I get annoyed with the spaces/tabs mixture too. It just makes the diff much tidier that way. |
Sorry, that's something in my Visual Studio settings, I think.
|
I'll look at it.
|
Meanwhile, how to see changes ignoring whitespace difference: add "/?w=1" to the link: https://github.com/monkey0506/ags/commit/5347be46294abc0777c9094150ddbf7a902613d0/?w=1 |
Wow, CW, that's awesome! |
Re arrays, they seem to work. I wonder why Chris Jones did not add them earlier. Is it simply forgetfulness or there's a hidden problem? Need to investigate this a bit more. |
This comment was marked as abuse.
This comment was marked as abuse.
They are supposed to be stored by reference, as well as all other "managed" types in AGS script. |
AFAICT, yes, the dynamic arrays are only stored by reference, while the actual memory is allocated in the managed object pool (to provide reference counting and garbage collection). With the introduction of by-reference user types by @gurok , this seemed a logical next step. Since the arrays are stored/passed by reference, this should only ever increase the size of a struct by 4 bytes, as with any other pointer. There was no indication that I could find as to why CJ disallowed them from being included in structs, but I agree that this should be very thoroughly tested before pulling it in. This seemed the most appropriate route to do that. |
I rebased the commit to ignore whitespace changes. |
Call me nagger, but the file has spaces for indentation, and your commit introduces tabs. E: I tried different combinations, and I don't see any problem with this feature so far. |
Changing the Visual Studio settings to use spaces introduced over 2000 changes, so I'm a bit skeptical that there weren't already tabs used throughout the file. I went ahead and checked out the cached copy of the file and manually redid my work on top of it. This diff should only reflect the actual, relevant changes, and I made sure to use spaces not tabs. |
Hmm, ok. We might do an automatic replacement at some point maybe. Thank you, and sorry for bothering. |
Modified compiler to allow dynamic arrays within structs
This allows dynamic arrays to be included in structs. Preliminary testing shows this works. Tested saving and loading as well.