stos: ob: Add object cache groundwork
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user