the preallocated objcore
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3797
d4fa192b-c00b-0410-8231-
f00ffab90ce4
CHECK_OBJ_NOTNULL(w->nobj, OBJECT_MAGIC);
}
+void
+HSH_Cleanup(struct worker *w)
+{
+
+ if (w->nobjcore != NULL) {
+ FREE_OBJ(w->nobjcore);
+ w->nobjcore = NULL;
+ }
+ if (w->nobjhead != NULL) {
+ Lck_Delete(&w->nobjhead->mtx);
+ FREE_OBJ(w->nobjhead);
+ w->nobjhead = NULL;
+ w->stats->n_objecthead--;
+ }
+ if (w->nobj != NULL) {
+ STV_free(w->nobj->objstore);
+ w->nobj = NULL;
+ w->stats->n_object--;
+ }
+}
+
void
HSH_DeleteObjHead(struct worker *w, struct objhead *oh)
{
AZ(pthread_cond_destroy(&w->cond));
if (w->srcaddr != NULL)
free(w->srcaddr);
- if (w->nobjhead != NULL) {
- Lck_Delete(&w->nobjhead->mtx);
- FREE_OBJ(w->nobjhead);
- }
- if (w->nobj!= NULL)
- STV_free(w->nobj->objstore);
+ HSH_Cleanup(w);
+ WRK_SumStat(w);
return (NULL);
}
*/
struct sess;
+struct worker;
struct object;
typedef void hash_init_f(int ac, char * const *av);
/* cache_hash.c */
void HSH_Prealloc(struct sess *sp);
+void HSH_Cleanup(struct worker *w);
void HSH_Freestore(struct object *o);
void HSH_Copy(const struct sess *sp, struct objhead *o);
struct object *HSH_Lookup(struct sess *sp);