Commit 823535a1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

FlexeLint inspired garbage collection



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4969 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0dca09dc
...@@ -39,15 +39,12 @@ extern pid_t mgt_pid; ...@@ -39,15 +39,12 @@ extern pid_t mgt_pid;
void VCA_tweak_waiter(struct cli *cli, const char *arg); void VCA_tweak_waiter(struct cli *cli, const char *arg);
/* mgt_shmem.c */ /* mgt_shmem.c */
void *mgt_SHM_Alloc(unsigned size, const char *class, const char *type, const char *ident);
extern struct vsc_main *VSL_stats; extern struct vsc_main *VSL_stats;
extern struct vsm_head *loghead;
/* varnishd.c */ /* varnishd.c */
struct vsb; struct vsb;
extern struct vsb *vident; extern struct vsb *vident;
int Symbol_Lookup(struct vsb *vsb, void *ptr); int Symbol_Lookup(struct vsb *vsb, void *ptr);
extern unsigned L_arg;
#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr)) #define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
......
...@@ -77,26 +77,20 @@ struct objhead { ...@@ -77,26 +77,20 @@ struct objhead {
int refcnt; int refcnt;
VTAILQ_HEAD(,objcore) objcs; VTAILQ_HEAD(,objcore) objcs;
unsigned char digest[DIGEST_LEN]; unsigned char digest[DIGEST_LEN];
union { VTAILQ_HEAD(, sess) waitinglist;
VTAILQ_HEAD(, sess) __u_waitinglist;
VTAILQ_ENTRY(objhead) __u_coollist;
} __u;
#define waitinglist __u.__u_waitinglist
#define coollist __u.__u_coollist
/*---------------------------------------------------- /*----------------------------------------------------
* The fields below are for the sole private use of * The fields below are for the sole private use of
* the hash implementation(s). * the hash implementation(s).
*/ */
union { union {
void *filler[3];
struct { struct {
VTAILQ_ENTRY(objhead) u_n_hoh_list; VTAILQ_ENTRY(objhead) u_n_hoh_list;
void *u_n_hoh_head; void *u_n_hoh_head;
} n; } n;
} u; } _u;
#define hoh_list u.n.u_n_hoh_list #define hoh_list _u.n.u_n_hoh_list
#define hoh_head u.n.u_n_hoh_head #define hoh_head _u.n.u_n_hoh_head
}; };
void HSH_DeleteObjHead(struct worker *w, struct objhead *oh); void HSH_DeleteObjHead(struct worker *w, struct objhead *oh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment