Saving and loading large data sets easily and efficiently

Bastiaan Veelo Bastiaan at Veelo.net
Thu Oct 3 14:38:35 UTC 2019


On Monday, 30 September 2019 at 20:10:21 UTC, Brett wrote:
[...]
> The way the data is structured is that I have a master array of 
> non-ptr structs.
>
> E.g.,
>
> S[] Data;
> S*[] OtherStuff;
>
> then every pointer points to an element in to Data. I did not 
> use int's as "pointers" for a specific non-relevant reason [...]

I would seriously consider turning that around and work with 
indices primarily, then take the address of an indexed element 
whenever you do need a pointer for that specific non-relevant 
reason. It makes I/O trivial, and it is safer too.

size_t[] OtherStuff;
size_t[int] MoreStuff;

Bastiaan.


More information about the Digitalmars-d-learn mailing list