Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue 115: accont for CAS in item_size_ok
  • Loading branch information
trondn committed Aug 8, 2011
1 parent 2c56090 commit 911c9d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions items.c
Expand Up @@ -242,8 +242,13 @@ bool item_size_ok(const size_t nkey, const int flags, const int nbytes) {
char prefix[40];
uint8_t nsuffix;

return slabs_clsid(item_make_header(nkey + 1, flags, nbytes,
prefix, &nsuffix)) != 0;
size_t ntotal = item_make_header(nkey + 1, flags, nbytes,
prefix, &nsuffix);
if (settings.use_cas) {
ntotal += sizeof(uint64_t);
}

return slabs_clsid(ntotal) != 0;
}

static void item_link_q(item *it) { /* item is the new head */
Expand Down

0 comments on commit 911c9d0

Please sign in to comment.