Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

save and restore -- how do they do it?

4 views
Skip to first unread message

luserXtrog

unread,
Jun 12, 2009, 10:31:45 PM6/12/09
to
I know I've asked this before and got a lot of helpful reples,
but I feel I still need more guidance. How do save and
restore really work? It appears that the mechanism should
work as though the entire memory footprint should be
copied into a new memory space for later restoring.
But actually doing this way just seems like too much of a headache.
Sysiphus and Prometheus.

So does the following sketch of an approach appear
feasible?

Store the current save level in a global integer.
Add a new member to all composite data-types
which is an integer representing this data's level.
Add a new member to all composite data-types
which is a pointer to its previous level.

This way the save and restore procedures need only
manipulate the global integer; but all "get" functions
will need to check for data with higher than the current
level and pop down the chain; and all "store" functions
need to check for data with lower than the current
level and push a new structure on the chain to contain
the new value.

My implementation is in C but I've tried to keep the
description language-neutral so as to invite opinions
from persons of varying expertise.

I think I'm just afraid of writing a routine to walk
through everything.

--
lxt

0 new messages