Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
284ed5fb
Commit
284ed5fb
authored
Feb 26, 1999
by
simonm
Browse files
[project @ 1999-02-26 12:43:58 by simonm]
Fix bug in finalizeWeakPointersNow - some weak ptrs could be missed.
parent
308bf20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/rts/Weak.c
View file @
284ed5fb
/* -----------------------------------------------------------------------------
* $Id: Weak.c,v 1.
8
1999/02/
11 14:22
:5
5
simonm Exp $
* $Id: Weak.c,v 1.
9
1999/02/
26 12:43
:5
8
simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -19,14 +19,19 @@ StgWeak *weak_ptr_list;
* finalizeWeakPointersNow() is called just before the system is shut
* down. It runs the finalizer for each weak pointer still in the
* system.
*
* Careful here - rts_evalIO might cause a garbage collection, which
* might change weak_ptr_list. Must re-load weak_ptr_list each time
* around the loop.
*/
void
finalizeWeakPointersNow
(
void
)
{
StgWeak
*
w
;
for
(
w
=
weak_ptr_list
;
w
;
w
=
w
->
link
)
{
while
((
w
=
weak_ptr_list
))
{
weak_ptr_list
=
w
->
link
;
IF_DEBUG
(
weak
,
fprintf
(
stderr
,
"Finalising weak pointer at %p -> %p
\n
"
,
w
,
w
->
key
));
w
->
header
.
info
=
&
DEAD_WEAK_info
;
if
(
w
->
finalizer
!=
&
NO_FINALIZER_closure
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment