diff options
author | dormando <dormando@rydia.net> | 2018-05-22 18:06:21 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2018-05-22 19:26:28 -0700 |
commit | 91102e15c86c5ed7010670a58f151734a196cc11 (patch) | |
tree | 78840c57b63d8b2ca033c2071c0f7bd86ab87e3d /storage.c | |
parent | f939a8468cb4b9a219a1a34cdcef5338a8b84a77 (diff) | |
download | memcached-91102e15c86c5ed7010670a58f151734a196cc11.tar.gz |
alignment and 32bit fixes for extstore
memory alignment when reading header data back.
left "32" in a few places that should've at least been a define, is now
properly an offsetof. used for skipping crc32 for dynamic parts of the item
headers.
Diffstat (limited to 'storage.c')
-rw-r--r-- | storage.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -81,7 +81,7 @@ int lru_maintainer_store(void *storage, const int clsid) { int copied = 0; // copy original header int hdrtotal = ITEM_ntotal(it) - it->nbytes; - memcpy((char *)io.buf+32, (char *)it+32, hdrtotal - 32); + memcpy((char *)io.buf+STORE_OFFSET, (char *)it+STORE_OFFSET, hdrtotal - STORE_OFFSET); copied = hdrtotal; // copy data in like it were one large object. while (sch && remain) { @@ -93,11 +93,11 @@ int lru_maintainer_store(void *storage, const int clsid) { sch = sch->next; } } else { - memcpy((char *)io.buf+32, (char *)it+32, io.len-32); + memcpy((char *)io.buf+STORE_OFFSET, (char *)it+STORE_OFFSET, io.len-STORE_OFFSET); } // crc what we copied so we can do it sequentially. buf_it->it_flags &= ~ITEM_LINKED; - buf_it->exptime = crc32c(0, (char*)io.buf+32, orig_ntotal-32); + buf_it->exptime = crc32c(0, (char*)io.buf+STORE_OFFSET, orig_ntotal-STORE_OFFSET); extstore_write(storage, &io); item_hdr *hdr = (item_hdr *) ITEM_data(hdr_it); hdr->page_version = io.page_version; |