Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Scott <conrad.scott@dsl.pipex.com>2002-08-06 07:40:40 +0400
committerConrad Scott <conrad.scott@dsl.pipex.com>2002-08-06 07:40:40 +0400
commitffebb4fe0c3e1c3ca5ab14ec7737da054e2dc096 (patch)
tree85aad811c50af03bb7a547d2c5341d98a8a6f930 /winsup/cygwin/debug.cc
parent8d0bc156efc1246ce894f7d844a41384383c0c7f (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/debug.cc')
-rw-r--r--winsup/cygwin/debug.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index 280cbb44d..418f35510 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