Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
b9dfc5ac
Commit
b9dfc5ac
authored
Jan 28, 2003
by
simonmar
Browse files
[project @ 2003-01-28 17:05:43 by simonmar]
Make it multi-init-safe
parent
ae643785
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/rts/Stable.c
View file @
b9dfc5ac
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
* $Id: Stable.c,v 1.2
3
200
2/12/19 14:25:05
simonmar Exp $
* $Id: Stable.c,v 1.2
4
200
3/01/28 17:05:43
simonmar Exp $
*
*
* (c) The GHC Team, 1998-2002
* (c) The GHC Team, 1998-2002
*
*
...
@@ -90,10 +90,10 @@
...
@@ -90,10 +90,10 @@
make sure we can still find the object.
make sure we can still find the object.
*/
*/
snEntry
*
stable_ptr_table
;
snEntry
*
stable_ptr_table
=
NULL
;
static
snEntry
*
stable_ptr_free
;
static
snEntry
*
stable_ptr_free
=
NULL
;
static
unsigned
int
SPT_size
;
static
unsigned
int
SPT_size
=
0
;
/* This hash table maps Haskell objects to stable names, so that every
/* This hash table maps Haskell objects to stable names, so that every
* call to lookupStableName on a given object will return the same
* call to lookupStableName on a given object will return the same
...
@@ -128,7 +128,7 @@ static unsigned int SPT_size;
...
@@ -128,7 +128,7 @@ static unsigned int SPT_size;
* to the weight stored in the table entry.
* to the weight stored in the table entry.
* */
* */
static
HashTable
*
addrToStableHash
;
static
HashTable
*
addrToStableHash
=
NULL
;
#define INIT_SPT_SIZE 64
#define INIT_SPT_SIZE 64
...
@@ -150,12 +150,9 @@ initFreeList(snEntry *table, nat n, snEntry *free)
...
@@ -150,12 +150,9 @@ initFreeList(snEntry *table, nat n, snEntry *free)
void
void
initStablePtrTable
(
void
)
initStablePtrTable
(
void
)
{
{
/* the table will be allocated the first time makeStablePtr is
// Nothing to do:
* called */
// the table will be allocated the first time makeStablePtr is
stable_ptr_table
=
NULL
;
// called, and we want the table to persist through multiple inits.
stable_ptr_free
=
NULL
;
addrToStableHash
=
NULL
;
SPT_size
=
0
;
}
}
/*
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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