This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, fortran, gcc] PR35063 [Regression wrt g77] I/O leaks handles/memory on Windows XP
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, dannysmith at users dot sourceforge dot net
- Date: Fri, 08 Feb 2008 15:42:10 -0800
- Subject: [patch, fortran, gcc] PR35063 [Regression wrt g77] I/O leaks handles/memory on Windows XP
Hi all,
This patch fixes this bug. Danny Smith provided the portion that added the
needed CloseHandle to destroy the mutex properly. I developed the portion in
unit.c that uses this, with his suggestions.
Regression tested on x86-64, tested on Cygwin that it fixes both cases in
comments 1 and 7. Test likewise by Mikko on mingw.
I think this should get into 4.3.
Ok to commit? I need a gcc maintainer to approve as well.
Regards,
Jerry
2008-02-08 Danny Smith <dannysmith@users.sourceforge.net>
PR gcc/35063
* gthr-win32.h (__gthread_mutex_destroy_function): New function
to CloseHandle after unlocking to prevent accumulation of handle
count.
2008-02-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/35063
* io/unit.c (destroy_unit_mutex): New function that uses
__gthread_mutex_destroy_function or pthread_mutex_destroy after
unlocking and before free_mem for final closure of I/O unit.
(delete_root): Use new function.
(free_internal_unit): Likewise.
(close_unit_1): Likewise.