🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Marc Andreessen Fri, 27 Nov 1992 20:47
possible epoch memory leak fix
#1124
Author: Marc Andreessen
Date: Fri, 27 Nov 1992 20:47
103 lines
3548 bytes
Following is an unofficial patch to Epoch 4.2 that purports to fix the
memory leak that occurs when a zone is deleted.  My tests show that it
seems to be working, but it's almost 5 in the morning and I'm feverish
with fatigue so don't take that for granted.

Let me know how it works (or doesn't, as the case may be)......

---------------------------------- CUT HERE ----------------------------------
*** alloc.c.orig	Wed Aug  5 03:18:33 1992
--- alloc.c	Sat Nov 28 04:33:52 1992
***************
*** 32,37 ****
--- 32,38 ----
  #ifndef standalone
  #include "buffer.h"
  #include "window.h"
+ #include "button.h" /* epoch */
  #endif
  
  #define max(A,B) ((A) > (B) ? (A) : (B))
***************
*** 1074,1080 ****
      case Lisp_Process:
      case Lisp_Window_Configuration:
      case Lisp_Root_Block:	/* Epoch */
-     case Lisp_Button:
      case Lisp_Style:
        {
  	register struct Lisp_Vector *ptr = XVECTOR (obj);
--- 1075,1080 ----
***************
*** 1085,1090 ****
--- 1085,1108 ----
  	ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */
  	for (i = 0; i < size; i++)     /* and then mark its elements */
  	  mark_object (&ptr->contents[i]);
+       }
+       break;
+ 
+     case Lisp_Button:
+       {
+ 	register struct Lisp_Vector *ptr = XVECTOR (obj);
+         register struct Lisp_Button *b = XBUTTON (obj);
+ 	register int size = ptr->size;
+ 	register int i;
+ 
+ 	if (size & ARRAY_MARK_FLAG) break;   /* Already marked */
+         /* If it's not dead meat, go ahead and mark it. */
+         if (NIL(b->dead_meat))
+           {
+             ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */
+             for (i = 0; i < size; i++)     /* and then mark its elements */
+               mark_object (&ptr->contents[i]);
+           }
        }
        break;
  
*** button.c.orig	Wed Aug  5 01:03:25 1992
--- button.c	Sat Nov 28 04:24:40 1992
***************
*** 792,797 ****
--- 792,799 ----
  	  unchain_marker(button->start);
  	  unchain_marker(button->end);
  	  button->prev = Qnil;
+           /* HACK here. */
+           button->dead_meat = Qt;
  	  buttons = button->next;
  	  button->next = Qnil;
  	}
***************
*** 1010,1015 ****
--- 1012,1019 ----
    if (!bf) return button;	
  
    RemoveButtonFromBuffer(b,bf,1); /* remove and unchain markers */
+   b->dead_meat = Qt;
+   /* HACK here. */
    return button;
  }
  
*** button.h.orig	Wed Aug  5 01:03:26 1992
--- button.h	Sat Nov 28 04:23:41 1992
***************
*** 31,36 ****
--- 31,38 ----
    Lisp_Object read_only;
    /* flag - is button "transient" */
    Lisp_Object transient;
+   /* flag - is button dead meat */
+   Lisp_Object dead_meat;
  };
  
  struct Lisp_Style
---------------------------------- CUT HERE ----------------------------------

Marc

--
Marc Andreessen
Software Development Group
National Center for Supercomputing Applications
marca@ncsa.uiuc.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads