[fpc-pascal] Set size limit

Daniel Gaspary dgaspary at gmail.com
Sun Mar 10 15:28:17 CET 2013


On Sun, Mar 10, 2013 at 11:12 AM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> For larger sets, especially if they are sparse, a simple hashtable-based class
> would probably be much faster and memory efficient

Just some background..

I was using a Set because I needed a initialized constant "container"
with a variable length.

It was a array of records, the set would be one of the fields. I
believe it's not possible to have dynamic array initialized inside
records.

TMyRecord = record
   TheSet: TMySet;
end;

const
        MyArray: array[TMyEnum] of TMyRecord = ( (TheSet: [me1, me3]),
(TheSet: [me2, me1]) );

Now I have changed the code to a function with a case returning the record.



More information about the fpc-pascal mailing list