Commit fa7f41b5 authored by Niels Möller's avatar Niels Möller
Browse files

*** empty log message ***

Rev: ChangeLog:1.25
Rev: doc/NOTES:1.4
Rev: doc/TODO:1.27
Rev: src/acconfig.h:1.5
Rev: src/digit_table.c:1.2
Rev: src/gc.c:1.4
Rev: src/gc.h:1.3
Rev: src/sexp.h:1.9
parent 1c0e028a
Mon Jan 4 11:25:43 1999 <nisse@puck>
* werror.c: Avoid using stdio functions.
* keyexchange.c (make_test_kexinit): Commented out this function.
* io.c (write_raw): New function.
(write_raw_with_poll): -"-
* alist.c (alist_addv): New function.
(alist_add): -"-
Fri Jan 1 04:20:10 1999 <nisse@puck>
* make_char_classes (make-char-classes): Use #ifdef to separate
......
......@@ -98,6 +98,12 @@ http://viks.mvrop.org/networking/sock_advanced_tut.html
Text-Terminal-HOWTO
http://www.developer.ibm.com/library/ref/about4.1/df4commo.html
Jon Ribbens <jon@oaktree.co.uk>:
The other functions can be found at
ftp://ftp.openbsd.org/pub/OpenBSD/src/lib/libutil/pty.c
3605942 idag 07:59 /32 rader/ assar
Kommentar till text 3578895 av Niels Möller ()
......
......@@ -190,3 +190,6 @@ It seems that it is a little difficult to detect that an asyncronous
connect() failed; poll() indicates that both reading and writing is
possible, but write failes (with EPIPE/SIGPIPE) later. Perhaps a
linux-problem?
Key expansion in keyexchenge.c is broken (uses a KILL()ed hash
instance).
......@@ -14,3 +14,7 @@
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* Define if the compiler understands __attribute__ */
#undef HAVE_ATTRIBUTE
......@@ -93,6 +93,3 @@ int main(int argc UNUSED, char *argv UNUSED)
return 0;
}
......@@ -32,8 +32,10 @@
/* Global variables */
static struct lsh_object *all_objects = NULL;
unsigned number_of_objects = 0;
unsigned live_objects = 0;
static struct lsh_object *globals = NULL;
static unsigned number_of_objects = 0;
static unsigned live_objects = 0;
#ifdef DEBUG_ALLOC
static void sanity_check_object_list(void)
......@@ -42,7 +44,7 @@ static void sanity_check_object_list(void)
struct lsh_object *o;
#if 0
werror("sanity_check_object_list: Objects on list:\n");
wwrite("sanity_check_object_list: Objects on list:\n");
for(o = all_objects; o; o = o->next)
werror(" %p, class: %s\n", (void *) o, o->isa ? o->isa->name : "UNKNOWN");
#endif
......@@ -150,6 +152,21 @@ void gc_register(struct lsh_object *o)
#endif
}
/* FIXME: This function is utterly broken, and should be deleted. */
void gc_register_global(struct lsh_object *o)
{
#ifdef DEBUG_ALLOC
sanity_check_object_list();
#endif
o->marked = o->dead = 0;
o->next = globals;
globals = o;
#ifdef DEBUG_ALLOC
sanity_check_object_list();
#endif
}
/* FIXME: This function should really deallocate and forget the object
* early. But we keep it until the next gc, in order to catch any
* references to killed objects. */
......@@ -171,17 +188,20 @@ void gc_kill(struct lsh_object *o)
#endif
}
void gc(struct lsh_object *root)
void gc(void)
{
unsigned before = number_of_objects;
struct lsh_object *o;
gc_mark(root);
for (o = globals; o; o = o->next)
gc_mark(o);
gc_sweep();
verbose("Objects alive: %d, garbage collected: %d\n", live_objects,
before - live_objects);
}
void gc_maybe(struct lsh_object *root, int busy)
void gc_maybe(int busy)
{
#ifdef DEBUG_ALLOC
sanity_check_object_list();
......@@ -190,6 +210,6 @@ void gc_maybe(struct lsh_object *root, int busy)
if (number_of_objects > (100 + live_objects*(2+busy)))
{
verbose("Garbage collecting while %s...\n", busy ? "busy" : "idle");
gc(root);
gc();
}
}
......@@ -26,17 +26,14 @@
#ifndef LSH_GC_H_INCLUDED
#define LSH_GC_H_INCLUDED
#include "lsh_types.h"
#include "lsh.h"
void gc_register_global(struct lsh_object *o);
void gc_register(struct lsh_object *o);
void gc_kill(struct lsh_object *o);
void gc(struct lsh_object *root);
void gc_maybe(struct lsh_object *root, int busy);
#if 0
void gc_mark(struct lsh_object *o);
void gc_sweep(void);
#endif
void gc(void);
void gc_maybe(int busy);
#endif /* LSH_GC_H_INCLUDED */
......@@ -29,6 +29,8 @@
#include "bignum.h"
#include "list.h"
#include "sexp_table.h"
/* Forward declaration */
struct sexp_iterator;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment