stos: ob: Pull object from cache on creation
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
+7
-1
@@ -66,13 +66,19 @@ ObCreateObject(const CHAR *Name, OBJECT_TYPE Type, VOID *Data, ST_OBJECT **Resul
|
||||
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(
|
||||
POOL_NON_PAGED,
|
||||
sizeof(*Object),
|
||||
OBJECT_POOL_TAG
|
||||
);
|
||||
|
||||
if (Object == NULL) {
|
||||
if (Object == NULL)
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user