Răsfoiți Sursa

* (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)
-This actually CAUSED cpu-spins after segfaults.


svn: 2321

Bryan Drewery 21 ani în urmă
părinte
comite
2f11f34975
2 a modificat fișierele cu 5 adăugiri și 9 ștergeri
  1. 3 1
      doc/UPDATES
  2. 2 8
      src/compat/memutil.c

+ 3 - 1
doc/UPDATES

@@ -12,6 +12,9 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 - Added hijacked invite detection based on server invite notices.
 
 1.2.6
+* (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)
+  -This actually CAUSED cpu-spins after segfaults.
+
 
 1.2.5
 * Fixed a segfault/cpu-spin with mode parsing. (#25)
@@ -140,7 +143,6 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * cmd_update/cmd_restart/SIGHUP now soft restarts bot
 * Shell cmd param -u now soft restarts all running bots after updating binary
 * cmd_dump now has a substitution. '$n' is replaced with the bot's current IRC nick.
-* Disabled all memory allocations after a segfault (Fixes CPU spinning)
 * Changed password encryption, should auto convert, might need to reset all though. (#75)
 * Adding hosts with missing nick/ident will now prefix the host with '*!' and '*!*' respectively.
 

+ 2 - 8
src/compat/memutil.c

@@ -30,26 +30,20 @@ strdup(const char *entry)
 
 void *my_calloc(size_t nmemb, size_t size)
 {
-  if (segfaulted)
-    return NULL;
-
   void *ptr = calloc(nmemb, size);
 
   if (ptr == NULL)
-    fatal("Cannot allocate memory", 0);
+    exit(5);
   
   return ptr;
 }
 
 void *my_realloc(void *ptr, size_t size)
 {
-  if (segfaulted)
-    return NULL;
-
   void *x = realloc(ptr, size);
 
   if (x == NULL && size > 0)
-    fatal("Cannot allocate memory", 0);
+    exit(5);
 
   return x;
 }