On Nov 10, 11:51 am, mattschinkel <[email protected]> wrote: > If you make a variable and don't use it, it does not get allocated in > memory, it's a feature of jalv2. The compiler also ignores functions & > procedures that do not get used. >
Hi Matt, At the moment, the library is essentially 'one large array'.jal. Which is a fine thing, but perhaps not as generally useful as it might be, with some refactoring. If you are going to take advantage of this 'automatic removal of unused variables' feature of the compiler, then it seems to me you can get rid of a huge amount of the code -- For example, for the large 'byte' arrays, you can just use these same 8 arrays for all cases of large 'byte' arrays: var byte large_array_byte_1h[256] var byte large_array_byte_2h[256] var byte large_array_byte_3h[256] var byte large_array_byte_4h[256] var byte large_array_byte_5h[256] var byte large_array_byte_6h[256] var byte large_array_byte_7h[256] var byte large_array_byte_8h[256] And then, for example, in the 'get' and 'put' routines, if your LARGE_ARRAY_SIZE is smaller than 1792, then large_array_byte_8h will never be referenced, and so the compiler will not allocate any space for it. Likewise, if LARGE_ARRAY_SIZE is smaller than 1536, then large_array_byte_7h won't be referenced. Now, turning to some other points we've been discussing: You mention that a person could make multiple copies of the library and thereby have multiple large arrays-- not really, since almost every line of the nearly 800 line library would need to be edited to prevent compile errors - duplicate variable names, etc. That is why I was brainstorming for ways to use some sort of template and generator tool. Regarding breaking up the library into 3 smaller libraries, for byte, word, and dword: How about this: make it a two-level library-- the name 'large_array.jal' could simply be a wrapper that includes the 3 lower-level libraries. William --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
