Here's another iteration on the portable dumper code for Windows. This is still just
a prototype of what might be acceptable, but it does work and I think it is an improvement
on the previous.
I moved all the system dependent code into sysdep.c. This probably isn't the best
place for it, but it is better than alloc.c and it can be moved again if there is a better
place, now or in the future.
This code looks for the portable dump data first in an external file. Currently it finds
this file the way it always has, but if there is a better way to find and validate it
(using a unique ID and/or a time stamp) that can easily be added. I didn't see any
reason to try to duplicate that work which I think someone else is doing. It maps the
file into VM on Windows and if mmap exists on Unix, otherwise it allocates a buffer and
reads it in.
If there isn't an external dump file, it then looks for a resource in the XEmacs
binary. This is done only in the Windows version, but if there is a good way to do it on
at least some versions of Unix that can also be added easily. I don't know enough
about the proper way to do such things on Unix to do it myself. This resource is added to
xemacs.exe during build using the standard linker and resource compiler tools already used
to build XEmacs. This should work on any system (NT or 95/98) that can build XEmacs.
This meant turning off incremental linking on Windows, but XEmacs is small enough that
this doesn't matter too much.
These changes meet many of the objections raised to the previous implementation. It
allows redumping and per use dump files since an external dump file takes precedence over
dump data in the resource section. There isn't any system dependent code in alloc.c
anymore. It allows you to build XEmacs on any Windows platform from Win95 up. It gets
all the system dependent code out of alloc.c.
Let me know what you think of this and how it still needs to be improved.
Mike Alexander