diff options
Diffstat (limited to 'src/libmdsserver/linked-list.c')
-rw-r--r-- | src/libmdsserver/linked-list.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libmdsserver/linked-list.c b/src/libmdsserver/linked-list.c index 916eaf9..601bda0 100644 --- a/src/libmdsserver/linked-list.c +++ b/src/libmdsserver/linked-list.c @@ -430,7 +430,7 @@ void linked_list_remove(linked_list_t* restrict this, ssize_t node) */ size_t linked_list_marshal_size(const linked_list_t* restrict this) { - return sizeof(size_t) * (4 + this->reuse_head + 3 * this->end); + return sizeof(size_t) * (4 + this->reuse_head + 3 * this->end) + sizeof(int); } @@ -442,6 +442,9 @@ size_t linked_list_marshal_size(const linked_list_t* restrict this) */ void linked_list_marshal(const linked_list_t* restrict this, char* restrict data) { + ((int*)data)[0] = LINKED_LIST_T_VERSION; + data += sizeof(int) / sizeof(char); + ((size_t*)data)[0] = this->capacity; ((size_t*)data)[1] = this->end; ((size_t*)data)[2] = this->reuse_head; @@ -473,6 +476,9 @@ int linked_list_unmarshal(linked_list_t* restrict this, char* restrict data) { size_t n; + /* ((int*)data)[0] == LINKED_LIST_T_VERSION */ + data += sizeof(int) / sizeof(char); + this->reusable = NULL; this->values = NULL; this->next = NULL; |