Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alexis King
GHC
Commits
ed12b704
Commit
ed12b704
authored
Dec 15, 2006
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Free more things that we allocate
parent
1f801e3a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
2 deletions
+64
-2
rts/Capability.c
rts/Capability.c
+8
-2
rts/Capability.h
rts/Capability.h
+3
-0
rts/ProfHeap.c
rts/ProfHeap.c
+19
-0
rts/Profiling.c
rts/Profiling.c
+6
-0
rts/Profiling.h
rts/Profiling.h
+1
-0
rts/RtsSignals.h
rts/RtsSignals.h
+2
-0
rts/RtsStartup.c
rts/RtsStartup.c
+8
-0
rts/Schedule.c
rts/Schedule.c
+5
-0
rts/posix/Signals.c
rts/posix/Signals.c
+7
-0
rts/win32/ConsoleHandler.c
rts/win32/ConsoleHandler.c
+5
-0
No files found.
rts/Capability.c
View file @
ed12b704
...
...
@@ -673,8 +673,7 @@ shutdownCapability (Capability *cap, Task *task)
continue
;
}
debugTrace
(
DEBUG_sched
,
"capability %d is stopped."
,
cap
->
no
);
stgFree
(
cap
->
mut_lists
);
freeSparkPool
(
&
cap
->
r
.
rSparks
);
freeCapability
(
cap
);
RELEASE_LOCK
(
&
cap
->
lock
);
break
;
}
...
...
@@ -712,4 +711,11 @@ tryGrabCapability (Capability *cap, Task *task)
#endif
/* THREADED_RTS */
void
freeCapability
(
Capability
*
cap
)
{
stgFree
(
cap
->
mut_lists
);
#if defined(THREADED_RTS) || defined(PARALLEL_HASKELL)
freeSparkPool
(
&
cap
->
r
.
rSparks
);
#endif
}
rts/Capability.h
View file @
ed12b704
...
...
@@ -232,6 +232,9 @@ extern void grabCapability (Capability **pCap);
#endif
/* !THREADED_RTS */
// Free a capability on exit
void
freeCapability
(
Capability
*
cap
);
/* -----------------------------------------------------------------------------
* INLINE functions... private below here
* -------------------------------------------------------------------------- */
...
...
rts/ProfHeap.c
View file @
ed12b704
...
...
@@ -316,6 +316,13 @@ initEra(Census *census)
census
->
drag_total
=
0
;
}
STATIC_INLINE
void
freeEra
(
Census
*
census
)
{
arenaFree
(
census
->
arena
);
freeHashTable
(
census
->
hash
,
NULL
);
}
/* --------------------------------------------------------------------------
* Increases era by 1 and initialize census[era].
* Reallocates gi[] and increases its size if needed.
...
...
@@ -355,6 +362,10 @@ void initProfiling1( void )
{
}
void
freeProfiling1
(
void
)
{
}
void
initProfiling2
(
void
)
{
if
(
RtsFlags
.
ProfFlags
.
doHeapProfile
)
{
...
...
@@ -493,6 +504,14 @@ endHeapProfiling(void)
}
#endif
{
nat
t
;
for
(
t
=
0
;
t
<=
era
;
t
++
)
{
freeEra
(
&
censuses
[
t
]
);
}
}
stgFree
(
censuses
);
seconds
=
mut_user_time
();
printSample
(
rtsTrue
,
seconds
);
printSample
(
rtsFalse
,
seconds
);
...
...
rts/Profiling.c
View file @
ed12b704
...
...
@@ -185,6 +185,12 @@ initProfiling1 (void)
*/
}
void
freeProfiling1
(
void
)
{
arenaFree
(
prof_arena
);
}
void
initProfiling2
(
void
)
{
...
...
rts/Profiling.h
View file @
ed12b704
...
...
@@ -13,6 +13,7 @@
#if defined(PROFILING) || defined(DEBUG)
void
initProfiling1
(
void
);
void
freeProfiling1
(
void
);
void
initProfiling2
(
void
);
void
endProfiling
(
void
);
...
...
rts/RtsSignals.h
View file @
ed12b704
...
...
@@ -41,6 +41,8 @@ extern void initUserSignals(void);
*/
extern
void
initDefaultHandlers
(
void
);
extern
void
freeSignalHandlers
(
void
);
/*
* Function: blockUserSignals()
*
...
...
rts/RtsStartup.c
View file @
ed12b704
...
...
@@ -378,6 +378,10 @@ hs_exit(void)
/* start timing the shutdown */
stat_startExit
();
#if defined(RTS_USER_SIGNALS)
freeSignalHandlers
();
#endif
#if defined(THREADED_RTS)
ioManagerDie
();
#endif
...
...
@@ -447,6 +451,10 @@ hs_exit(void)
/* free the stable pointer table */
exitStablePtrTable
();
#if defined(PROFILING) || defined(DEBUG)
freeProfiling1
();
#endif
#if defined(DEBUG)
/* free the thread label table */
freeThreadLabelTable
();
...
...
rts/Schedule.c
View file @
ed12b704
...
...
@@ -2581,6 +2581,8 @@ exitScheduler( void )
boundTaskExiting
(
task
);
stopTaskManager
();
}
#else
freeCapability
(
&
MainCapability
);
#endif
}
...
...
@@ -2588,6 +2590,9 @@ void
freeScheduler
(
void
)
{
freeTaskManager
();
if
(
n_capabilities
!=
1
)
{
stgFree
(
capabilities
);
}
#if defined(THREADED_RTS)
closeMutex
(
&
sched_mutex
);
#endif
...
...
rts/posix/Signals.c
View file @
ed12b704
...
...
@@ -545,4 +545,11 @@ initDefaultHandlers()
#endif
}
void
freeSignalHandlers
(
void
)
{
if
(
signal_handlers
!=
NULL
)
{
stgFree
(
signal_handlers
);
}
}
#endif
/* RTS_USER_SIGNALS */
rts/win32/ConsoleHandler.c
View file @
ed12b704
...
...
@@ -52,6 +52,11 @@ initUserSignals(void)
return
;
}
void
freeSignalHandlers
(
void
)
{
/* Do nothing */
}
/* Seems to be a bit of an orphan...where used? */
void
finiUserSignals
(
void
)
...
...
Write
Preview
Markdown
is supported
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