[Oberon] FPGA - OberonV4 Dialogs

Jörg joerg.straube at iaeth.ch
Thu Nov 15 10:52:40 CET 2018


Hi Tomas

As long as you have an ARRAY or a RECORD with some INTEGER fields or so, WriteBytes is okay.
But whenever you have POINTERs in your data structure, you can't just dump the memory to disk.
The next time you load that structure into memory again, your heap most probably looks totally different and the stored pointers on disk are not pointing to the correct data again.
So, while loading you have to properly allocate your pointer data structure again with NEW. To be able to call NEW you need info on the type you want to allocate on the heap. Either you store the type info you got by the module Type.Mod or - cleaner - you call an instantiation routine of the module where you imported the POINTER from and let that module do its job.

br
Jörg

Am 15.11.18, 10:25 schrieb "Oberon im Auftrag von Tomas Kral" <oberon-bounces at lists.inf.ethz.ch im Auftrag von thomas.kral at email.cz>:

    Hi Joerg,
    
    Not sure I got the idea of "externalisation" right, but I have tested
    loading and storing structured data using optimised Read/WriteBytes(). 
    https://github.com/tcat-qldom/Oberon-Read-WriteBytes
    My understanding is, that I need a way to instantiate run time type
    data with persistent data on disk? 
    
    -- 
    Tomas Kral <thomas.kral at email.cz>
    --
    Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
    https://lists.inf.ethz.ch/mailman/listinfo/oberon
    




More information about the Oberon mailing list