stos: ob: Add object cache groundwork

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-25 17:50:43 +00:00
parent 70f58b193f
commit bc11f9b58f
5 changed files with 155 additions and 1 deletions
+11 -1
View File
@@ -34,12 +34,14 @@ typedef enum {
* @RefCount: Object reference count
* @Type: Object type
* @Data: Object data
* @CacheNext: Used when reclaiming object
*/
typedef struct {
typedef struct _ST_OBJECT {
CHAR Name[OBJECT_NAMESZ];
ULONG RefCount;
OBJECT_TYPE Type;
VOID *Data;
struct _ST_OBJECT *CacheNext;
} ST_OBJECT;
/*
@@ -82,4 +84,12 @@ ST_STATUS ObCreateObject(
*/
VOID ObInitManager(VOID);
/*
* Reclaim an object after use, if its reference count is > 1, simply
* bump it down. Once it hits zero, the object is returned to the cache.
*
* @Object: Object to reclaim
*/
VOID ObReclaimObject(ST_OBJECT *Object);
#endif /* !_OB_OBJECT_H_ */