mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
Only finishing the cbs block pool when cbs created it. oops.
Copied from Perforce Change: 184488 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
57c9c5aac8
commit
b876c0ff82
2 changed files with 14 additions and 2 deletions
|
|
@ -212,6 +212,7 @@ Res CBSInitWithPool(Arena arena, CBS cbs, void *owner, Align alignment,
|
|||
cbs->fastFind = fastFind;
|
||||
cbs->alignment = alignment;
|
||||
cbs->inCBS = TRUE;
|
||||
cbs->blockPoolMine = FALSE;
|
||||
|
||||
METER_INIT(cbs->treeSearch, "size of tree", (void *)cbs);
|
||||
|
||||
|
|
@ -247,7 +248,16 @@ Res CBSInit(Arena arena, CBS cbs, void *owner, Align alignment,
|
|||
if (res != ResOK)
|
||||
return res;
|
||||
|
||||
return CBSInitWithPool(arena, cbs, owner, alignment, fastFind, blockPool);
|
||||
res = CBSInitWithPool(arena, cbs, owner, alignment, fastFind, blockPool);
|
||||
if (res != ResOK)
|
||||
goto failCBSInit;
|
||||
|
||||
cbs->blockPoolMine = TRUE;
|
||||
return ResOK;
|
||||
|
||||
failCBSInit:
|
||||
PoolDestroy(blockPool);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -266,7 +276,8 @@ void CBSFinish(CBS cbs)
|
|||
cbs->sig = SigInvalid;
|
||||
|
||||
SplayTreeFinish(treeOfCBS(cbs));
|
||||
PoolDestroy(cbs->blockPool);
|
||||
if (cbs->blockPoolMine)
|
||||
PoolDestroy(cbs->blockPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ typedef struct CBSStruct {
|
|||
Align alignment;
|
||||
Bool fastFind;
|
||||
Bool inCBS; /* prevent reentrance */
|
||||
Bool blockPoolMine;
|
||||
/* meters for sizes of search structures at each op */
|
||||
METER_DECL(treeSearch);
|
||||
Sig sig; /* sig at end because embeded */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue