I have a much better solution: I have written 3 C++ classes:
RFile(const char *const finname, ... );
RWFile(const char *const fioname, ... );
WFile(const char *const foname, ... );
No need to 'allocate'; it is very easy to mmap() the above files & then one can obtain a char/byte/short/word/int/dword/long/qword ptr to the file area. Writeable files are either auto-closed to their default alloc size or can be provided by a byte ptr to truncate to such size.