summaryrefslogtreecommitdiffstats
path: root/src/vector.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 20:00:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 20:00:36 +0200
commit6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6 (patch)
treea755a36afca70baaab878d391341129eb95e0873 /src/vector.h
parent2e14d72936d1ccfb6faed4a20dec7072fb6d8232 (diff)
downloadfastd-6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6.tar
fastd-6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6.zip
Store peers as vectors of pointers instead of linked lists
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vector.h b/src/vector.h
index 0d9d9be..701b64e 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -73,7 +73,8 @@ void _fastd_vector_delete(fastd_vector_desc_t *desc, void **data, size_t pos, si
#define VECTOR_ADD(v, elem) ({ \
__typeof__(v) *_v = &(v); \
- VECTOR_INSERT(*_v, (elem), _v->desc.length); \
+ __typeof__(*_v->data) _e = (elem); \
+ _fastd_vector_insert(&_v->desc, (void**)&_v->data, &_e, _v->desc.length, sizeof(_e)); \
})
#define VECTOR_DELETE(v, pos) ({ \