packagefs: Don't bother with depots for most of the object caches.

We want them for the heap buffers, but the rest will generally only
be used when other packagefs locks are acquired (during mounting
or unmounting of packages), so the depots are just a waste.
This commit is contained in:
Augustin Cavalier 2024-09-04 13:50:09 -04:00
parent d4d360a0d7
commit e5f569eedd
2 changed files with 7 additions and 6 deletions

View File

@ -1086,11 +1086,12 @@ packagefs_std_ops(int32 op, ...)
PackageFileHeapAccessorBase::sChunkCache =
create_object_cache_etc("pkgfs heap buffers",
PackageFileHeapAccessorBase::kChunkSize, sizeof(void*),
0, /* magazine capacity, count */ 2, 1, 0, NULL,
NULL, NULL, NULL);
0, /* magazine capacity, count */ 2, 1,
0, NULL, NULL, NULL, NULL);
TwoKeyAVLTreeNode<void*>::sNodeCache =
create_object_cache("pkgfs TKAVLTreeNodes",
sizeof(TwoKeyAVLTreeNode<void*>), 8, NULL, NULL, NULL);
create_object_cache_etc("pkgfs TKAVLTreeNodes",
sizeof(TwoKeyAVLTreeNode<void*>), 8,
0, 0, 0, CACHE_NO_DEPOT, NULL, NULL, NULL, NULL);
error = PackageFSRoot::GlobalInit();
if (error != B_OK) {

View File

@ -18,8 +18,8 @@
if (size != sizeof(CLASS)) \
panic("unexpected size passed to operator new!"); \
if (s##CLASS##Cache == NULL) { \
s##CLASS##Cache = create_object_cache("pkgfs " #CLASS "s", \
sizeof(CLASS), 8, NULL, NULL, NULL); \
s##CLASS##Cache = create_object_cache_etc("pkgfs " #CLASS "s", \
sizeof(CLASS), 8, 0, 0, 0, CACHE_NO_DEPOT, NULL, NULL, NULL, NULL); \
} \
\
return object_cache_alloc(s##CLASS##Cache, 0); \