🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.lisp.x
Article #343

xscheme SAVE/RESTORE

#343
From: Eric Raible
Date: Thu, 15 Feb 1990 00:37
74 lines
2388 bytes
I've been running with the following fix to xscheme for SAVE/RESTORE
for several days now.  It works on my large workspace.

This result is really due to others: someone (I forgot) who posted a
fix to findvmemory to not garbage collect, and to my office mate
Jeffery Hultquist, who fixed a subtle bug involving vscurrent (which
tripped him up for other reasons).

My only contribution was to recognize that his fix allowed successful
SAVE/RESTORE.

- Eric Raible (raible@nas.nasa.gov)

The Original:

findvmemory(size)
  int size;
{
    VSEGMENT *vseg;
    
    /* first try garbage collecting */
    gc();

    /* look for a vector segment with enough space */
    for (vseg = vsegments; vseg != NULL; vseg = vseg->vs_next)
	if (vseg->vs_free + size < vseg->vs_top) {
	    if (vscurrent != NULL)
		vscurrent->vs_free = vfree;
	    vfree = vseg->vs_free;
	    vtop = vseg->vs_top;
	    vscurrent = vseg;
	    return;
	}
    
    /* allocate a new vector segment and make it current */
    vexpand(1);
}

============================================================================

THE FIX:

1) change getvspace (xsimage.c) to call makevmemory instead of findvmemory.

2) replace findvmemory (xsdmem.c) with the following code:

findvmemory(size)
  int size;
{
    gc();
    makevmemory(size);
}

/* makevmemory - make vector memory (used by 'xsimage.c') */
makevmemory(size)
  int size;
{
    VSEGMENT *vseg;
    
    if (vscurrent != NULL)
      vscurrent->vs_free = vfree;

    /* look for a vector segment with enough space */
    for (vseg = vsegments; vseg != NULL; vseg = vseg->vs_next)
	if (vseg->vs_free + size < vseg->vs_top) {
	    vfree = vseg->vs_free;
	    vtop = vseg->vs_top;
	    vscurrent = vseg;
	    return;
	}
    
    /* allocate a new vector segment and make it current */
    vexpand(1);
}
Technical Details
Message-ID: <4913@amelia.nas.nasa.gov>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!eos!amelia!orville.nas.nasa.gov!raible

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!eos!amelia!orville.nas.nasa.gov!raible
From: raible@orville.nas.nasa.gov (Eric Raible)
Newsgroups: comp.lang.lisp.x
Subject: xscheme SAVE/RESTORE
Message-ID: <4913@amelia.nas.nasa.gov>
Date: 15 Feb 90 00:37:15 GMT
Sender: news@amelia.nas.nasa.gov
Reply-To: raible@orville.nas.nasa.gov (Eric Raible)
Organization: NASA Ames Research Center, Moffett Field, CA
Lines: 74