Avoid GC allocation in StaticTaskPool.
This commit is contained in:
parent
d66f257179
commit
a4eaafce9a
|
@ -421,10 +421,10 @@ private struct StaticTaskPool {
|
||||||
|
|
||||||
if (!m_refCount++) {
|
if (!m_refCount++) {
|
||||||
try {
|
try {
|
||||||
m_pool = new TaskPool(4);
|
m_pool = mallocT!TaskPool(4);
|
||||||
m_pool.isDaemon = true;
|
m_pool.isDaemon = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assert(false, "Failed to create file thread pool: "~e.msg);
|
assert(false, e.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,8 +447,10 @@ private struct StaticTaskPool {
|
||||||
|
|
||||||
if (fin_pool) {
|
if (fin_pool) {
|
||||||
log("finishing thread pool");
|
log("finishing thread pool");
|
||||||
try fin_pool.finish();
|
try {
|
||||||
catch (Exception e) {
|
fin_pool.finish(true);
|
||||||
|
freeT(fin_pool);
|
||||||
|
} catch (Exception e) {
|
||||||
//log("Failed to shut down file I/O thread pool.");
|
//log("Failed to shut down file I/O thread pool.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue