stos: ob: Pull object from cache on creation

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-25 14:39:47 -05:00
parent ceddcdba03
commit 53d0e27b4f
+7 -1
View File
@@ -66,13 +66,19 @@ ObCreateObject(const CHAR *Name, OBJECT_TYPE Type, VOID *Data, ST_OBJECT **Resul
return STATUS_NAME_TOO_LONG; return STATUS_NAME_TOO_LONG;
} }
/*
* Try to pull an object from the cache, if there are not
* objects to pull then we'll allocate one.
*/
Object = ObPopFromCache(&gObCache);
if (Object == NULL) {
Object = ExAllocatePoolWithTag( Object = ExAllocatePoolWithTag(
POOL_NON_PAGED, POOL_NON_PAGED,
sizeof(*Object), sizeof(*Object),
OBJECT_POOL_TAG OBJECT_POOL_TAG
); );
if (Object == NULL) { if (Object == NULL)
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
} }