Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
obsidiansystems
GHC
Commits
1712a9ed
Commit
1712a9ed
authored
Nov 26, 2015
by
Ben Gamari
🐢
Browse files
LibdwPool: Use poolTryTake
parent
c4308b46
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/LibdwPool.c
View file @
1712a9ed
...
...
@@ -16,6 +16,23 @@
#include
"Pool.h"
/*
* Note [libdw session pool]
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Building a libdw session requires a number of rather expensive steps,
*
* - Examine the object files mapped into the address space
* - Find them on disk
* - Open them and map their debugging information
* - Build various index structures necessary for quick lookup
*
* The time to setup a session can be several milliseconds. In order to avoid
* incurring this cost too often, we keep a pool of warm sessions around which
* can be shared between capabilities.
*
*/
static
Pool
*
pool
=
NULL
;
static
nat
pool_size
=
10
;
// TODO
...
...
@@ -26,7 +43,7 @@ void libdwPoolInit(void) {
}
LibdwSession
*
libdwPoolTake
(
void
)
{
return
poolTake
(
pool
);
return
poolT
ryT
ake
(
pool
);
}
void
libdwPoolRelease
(
LibdwSession
*
sess
)
{
...
...
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