Hmm.. I still don't think what you suggest will work for me.
I'm embarrassingly vague on OOP terminology, but I understand you're proposing a singleton pattern, whereby only a single instance of data-loader class is, or can be created.
Doesn't that inherently preclude the use of more than one instance of the class (ie more than one of my Loader objects, loading different files)?
That's exactly what @lokki wanted, but it's not really what I'm after.
I want something that works (to the user) in exactly the same way as a 'table/alloc' module and eg a 'table read', ie the user references the data in the 'loader' object by entering the name of the 'loader' in a text attribute of the 'reader' object.
I'd also need the Loader object to be 'poly-safe', by which I understand that if used polyphonically, it will not load the same data into SDRAM multiple times.
In the past, I was able to modify the factory 'table/alloc 16bt sdram' object to load my file into an 8-bit array in SDRAM, but this only worked because the size of the file to be loaded was known in advance, and could be set in a const.