MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / obj_init

Function obj_init

libCacheSim/cache/eviction/GLCache/obj.h:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "GLCacheInternal.h"
5
6static inline void obj_init(cache_t *cache, const request_t *req,
7 cache_obj_t *cache_obj, segment_t *seg) {
8 GLCache_params_t *params = cache->eviction_params;
9 copy_request_to_cache_obj(cache_obj, req);
10 cache_obj->GLCache.freq = 0;
11 cache_obj->GLCache.last_access_rtime = req->clock_time;
12 cache_obj->GLCache.last_access_vtime = params->curr_vtime;
13 cache_obj->GLCache.in_cache = 1;
14 cache_obj->GLCache.seen_after_snapshot = 0;
15 cache_obj->misc.next_access_vtime = req->next_access_vtime;
16
17 cache_obj->GLCache.segment = seg;
18 cache_obj->GLCache.idx_in_segment = seg->n_obj;
19}
20
21static inline int64_t obj_age(GLCache_params_t *params, cache_obj_t *obj) {
22 return params->curr_rtime - obj->GLCache.last_access_rtime;

Callers 1

GLCache_insertFunction · 0.85

Calls 1

Tested by

no test coverage detected