summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-10 06:08:07 +0000
committerXuefer <xuefer@gmail.com>2014-11-10 06:08:07 +0000
commitde6840d14b68c991a1408b752962aef14047ff8c (patch)
treeb6c82775fb1d6072a3bdbe4c83613b1b637948f5 /util
parentff9ba0d15ba2243dc69874242b61ca37065630c1 (diff)
downloadxcache-de6840d14b68c991a1408b752962aef14047ff8c.tar.gz
xcache-de6840d14b68c991a1408b752962aef14047ff8c.zip
closes #342: object caching
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1558 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'util')
-rw-r--r--util/xc_vector.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/xc_vector.h b/util/xc_vector.h
index 86ad804..bba5d5f 100644
--- a/util/xc_vector.h
+++ b/util/xc_vector.h
@@ -38,16 +38,19 @@ typedef struct {
static inline void xc_vector_destroy_impl(xc_vector_t *vector TSRMLS_DC)
{
+ vector->size = 0;
if (vector->data) {
pefree(vector->data, vector->persistent);
+ vector->data = NULL;
}
vector->capacity = 0;
- vector->size = 0;
+ vector->data_size = 0;
}
#define xc_vector_destroy(vector) xc_vector_destroy_impl(vector TSRMLS_CC)
#define xc_vector_size(vector) ((vector)->size)
+#define xc_vector_initialized(vector) ((vector)->data_size != 0)
#define xc_vector_element_ptr_(vector, index) ( \
(void *) ( \
((char *) (vector)->data) + (index) * (vector)->data_size \