help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] snapshot:andQuit:


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] snapshot:andQuit:
Date: Tue, 08 Jan 2008 12:00:45 +0100
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

I see ObjectMemory>>#snapshot:, but I don't see
ObjectMemory>>#snapshot:andQuit:. Am I missing something? Is there an
idiomatic way to check to see whether we're resuming just after save or
just after load?

No, I never thought of it.

Currently, #snapshot: returns ObjectMemory. Could it return a boolean,
or similar, indicating whether we're in the parent just after the save,
or the saved image just after the load?

Yes, it could. Note that if the caller of #snapshot: is a CallinProcess it does not survive image load; all CallinProcesses are not restarted in the saved image (see fixup_object in save.c).

It should be enough to change

      PROTECT_CURRENT_PROCESS_WITH (&localJmpBuf)
        success = _gst_save_to_file (fileName);

to

      /* fork(2)-style.  Return true for the saved file...  */
      SET_STACK_TOP (_gst_true_oop);
      PROTECT_CURRENT_PROCESS_WITH (&localJmpBuf)
        success = _gst_save_to_file (fileName);

      /* ... and false for the saving process.  */
      SET_STACK_TOP (_gst_false_oop);

in libgst/prims.def.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]