[erlang-questions] mmap file to binary

Mikael Pettersson mikpe@REDACTED
Fri Apr 9 20:53:32 CEST 2010


Sverker Eriksson writes:
 > Tony Rogvall wrote:
 > >>> Still the orig_bytes must be change. There are not to many places in the VM that uses the fact
 > >>> that orig_bytes is not a pointer, so the change should not be hard (if it's not done already ;-)
 > >>>
 > >>>       
 > >> I haven't understood: is the problem with orig_bytes now?
 > >>     
 > >
 > >
 > > Well...  OTP team? ;-)
 > >
 > >   
 > No, orig_bytes is still an array, but I don't think you need to change 
 > that. You could instead use the pointer 'bytes' in ProcBin to point to 
 > your mmap'ed data.
 > 
 > typedef struct proc_bin {
 >     Eterm thing_word;        /* Subtag REFC_BINARY_SUBTAG. */
 >     Uint size;            /* Binary size in bytes. */
 >     struct proc_bin *next;    /* Pointer to next ProcBin. */
 >     Binary *val;        /* Pointer to Binary structure. */
 >     byte *bytes;        /* Pointer to the actual data bytes. */
 >     Uint flags;            /* Flag word. */
 > } ProcBin;

... which is exactly what I wrote some number of messages ago.


More information about the erlang-questions mailing list