* dll_init.cc (dll_list::alloc): Add debugging assertion.

This commit is contained in:
Christopher Faylor 2010-05-03 16:40:33 +00:00
parent 6a0cef6012
commit 73bcd49b1f
2 changed files with 28 additions and 21 deletions

View File

@ -1,3 +1,7 @@
2010-05-03 Christopher Faylor <me+cygwin@cgf.cx>
* dll_init.cc (dll_list::alloc): Add debugging assertion.
2010-04-29 Corinna Vinschen <corinna@vinschen.de> 2010-04-29 Corinna Vinschen <corinna@vinschen.de>
* dlfcn.cc (get_full_path_of_dll): Handle non-existent file. * dlfcn.cc (get_full_path_of_dll): Handle non-existent file.

View File

@ -22,6 +22,7 @@ details. */
#include "exception.h" #include "exception.h"
#include <wchar.h> #include <wchar.h>
#include <sys/reent.h> #include <sys/reent.h>
#include <assert.h>
extern void __stdcall check_sanity_and_sync (per_process *); extern void __stdcall check_sanity_and_sync (per_process *);
@ -118,9 +119,9 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
{ {
if (!in_forkee) if (!in_forkee)
d->count++; /* Yes. Bump the usage count. */ d->count++; /* Yes. Bump the usage count. */
return d; /* Return previously allocated pointer. */
} }
else
{
/* FIXME: Change this to new at some point. */ /* FIXME: Change this to new at some point. */
d = (dll *) cmalloc (HEAP_2_DLL, sizeof (*d) + (namelen * sizeof (*name))); d = (dll *) cmalloc (HEAP_2_DLL, sizeof (*d) + (namelen * sizeof (*name)));
@ -141,6 +142,8 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
tot++; tot++;
if (type == DLL_LOAD) if (type == DLL_LOAD)
loaded_dlls++; loaded_dlls++;
}
assert (p->envptr != NULL);
return d; return d;
} }