mmlr + bonefish:
Add ObjectCache::ObjectAtIndex(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43086 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -245,6 +245,13 @@ ObjectCache::ReturnObjectToSlab(slab* source, void* object, uint32 flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void*
|
||||||
|
ObjectCache::ObjectAtIndex(slab* source, int32 index) const
|
||||||
|
{
|
||||||
|
return (uint8*)source->pages + source->offset + index * object_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if PARANOID_KERNEL_FREE
|
#if PARANOID_KERNEL_FREE
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public:
|
|||||||
|
|
||||||
void ReturnObjectToSlab(slab* source, void* object,
|
void ReturnObjectToSlab(slab* source, void* object,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
|
void* ObjectAtIndex(slab* source, int32 index) const;
|
||||||
|
|
||||||
bool Lock() { return mutex_lock(&lock) == B_OK; }
|
bool Lock() { return mutex_lock(&lock) == B_OK; }
|
||||||
void Unlock() { mutex_unlock(&lock); }
|
void Unlock() { mutex_unlock(&lock); }
|
||||||
|
|||||||
Reference in New Issue
Block a user