--------------------- PatchSet 2437 Date: 2001/05/31 15:55:23 Author: hno Branch: etag-2_4 Tag: (none) Log: Converted to old cbdata syntax with a separate cbdata registry Members: src/store.c:1.4.4.3.2.8.2.2.2.1->1.4.4.3.2.8.2.2.2.2 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.4.4.3.2.8.2.2.2.1 retrieving revision 1.4.4.3.2.8.2.2.2.2 diff -u -r1.4.4.3.2.8.2.2.2.1 -r1.4.4.3.2.8.2.2.2.2 --- squid/src/store.c 31 May 2001 15:39:12 -0000 1.4.4.3.2.8.2.2.2.1 +++ squid/src/store.c 31 May 2001 15:55:23 -0000 1.4.4.3.2.8.2.2.2.2 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.4.4.3.2.8.2.2.2.1 2001/05/31 15:39:12 hno Exp $ + * $Id: store.c,v 1.4.4.3.2.8.2.2.2.2 2001/05/31 15:55:23 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -401,8 +401,9 @@ int ignore:1; } current; } AddVaryState; -CBDATA_TYPE(AddVaryState); -static void free_AddVaryState(void *data) +static MemPool *AddVaryState_pool = NULL; + +static void free_AddVaryState(void *data, int dummy) { AddVaryState *state = data; debug(11, 0) ("free_AddVaryState: %p\n", data); @@ -432,6 +433,7 @@ memFree(state->buf, MEM_CLIENT_SOCK_BUF); state->buf = NULL; } + memPoolFree(AddVaryState_pool, state); } static void storeAddVaryFlush(AddVaryState *state) @@ -581,8 +583,10 @@ AddVaryState *state; http_version_t version; request_flags flags = null_request_flags; - CBDATA_INIT_TYPE_FREECB(AddVaryState, free_AddVaryState); - state = cbdataAlloc(AddVaryState); + if (!AddVaryState_pool) + AddVaryState_pool = memPoolCreate("AddVaryState", sizeof(AddVaryState)); + state = memPoolAlloc(AddVaryState_pool); + cbdataAdd(state, free_AddVaryState, -1); state->url = xstrdup(url); if (key) state->key = xstrdup(storeKeyText(key)); @@ -662,7 +666,13 @@ char *etag; } current; } LocateVaryState; -CBDATA_TYPE(LocateVaryState); +static MemPool *LocateVaryState_pool = NULL; + +static void +free_LocateVaryState(void *data, int dummy) +{ + memPoolFree(LocateVaryState_pool, data); +} static void storeLocateVaryCallback(LocateVaryState *state) @@ -767,10 +777,13 @@ { LocateVaryState *state; debug(11, 0) ("storeLocateVary: %s\n", vary_data); - CBDATA_INIT_TYPE(LocateVaryState); + if (!LocateVaryState_pool) { + LocateVaryState_pool = memPoolCreate("LocateVaryState", sizeof(LocateVaryState)); + } if (!VaryData_pool) VaryData_pool = memPoolCreate("VaryData", sizeof(VaryData)); - state = cbdataAlloc(LocateVaryState); + state = memPoolAlloc(LocateVaryState_pool); + cbdataAdd(state, free_LocateVaryState, -1); state->vary_data = xstrdup(vary_data); state->data = memPoolAlloc(VaryData_pool); state->e = e;