From: scottc Date: Tue, 6 Aug 2002 03:40:40 +0000 (+0000) Subject: * debug.h (handle_list::allocated): Remove field. X-Git-Tag: pre-no-this~982 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2f7e95ffa23d4ddfb0209a6eb88bbabd60b51cdf;p=pf3gnuchains%2Fpf3gnuchains4x.git * debug.h (handle_list::allocated): Remove field. * debug.cc (newh): Don't malloc extra entries. (add_handle): Downgrade strace message level. (delete_handle): Remove case for `allocated' entries. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 566389dfb7..4d56d17317 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2002-08-06 Conrad Scott + + * debug.h (handle_list::allocated): Remove field. + * debug.cc (newh): Don't malloc extra entries. + (add_handle): Downgrade strace message level. + (delete_handle): Remove case for `allocated' entries. + 2002-08-05 Christopher Faylor * cygthread.cc (cygthread::stub): Change event creation to manual diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc index 280cbb44d1..418f35510b 100644 --- a/winsup/cygwin/debug.cc +++ b/winsup/cygwin/debug.cc @@ -101,17 +101,9 @@ newh () for (hl = cygheap->debug.freeh; hl < cygheap->debug.freeh + NFREEH; hl++) if (hl->name == NULL) - goto out; - - /* All used up??? */ - if ((hl = (handle_list *) malloc (sizeof *hl)) != NULL) - { - memset (hl, 0, sizeof (*hl)); - hl->allocated = TRUE; - } + return hl; -out: - return hl; + return NULL; } /* Add a handle to the linked list of known handles. */ @@ -136,8 +128,8 @@ add_handle (const char *func, int ln, HANDLE h, const char *name, bool inh) if ((hl = newh ()) == NULL) { here.unlock (); - system_printf ("couldn't allocate memory for %s(%d): %s(%p)", - func, ln, name, h); + debug_printf ("couldn't allocate memory for %s(%d): %s(%p)", + func, ln, name, h); return; } hl->h = h; @@ -160,10 +152,7 @@ delete_handle (handle_list *hl) handle_list *hnuke = hl->next; debug_printf ("nuking handle '%s'", hnuke->name); hl->next = hl->next->next; - if (hnuke->allocated) - free (hnuke); - else - memset (hnuke, 0, sizeof (*hnuke)); + memset (hnuke, 0, sizeof (*hnuke)); } void diff --git a/winsup/cygwin/debug.h b/winsup/cygwin/debug.h index 56c922d60e..09a74e9170 100644 --- a/winsup/cygwin/debug.h +++ b/winsup/cygwin/debug.h @@ -81,7 +81,6 @@ extern int pinger; struct handle_list { - BOOL allocated; HANDLE h; const char *name; const char *func;