Commit bea9b8af authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3043 merge changes from code review to main refs[t:3043]

git-svn-id: file:///svn/toku/tokudb@25904 c7de825b-a66e-492c-adef-691d508d4ae1
parent 076ee90f
...@@ -1672,37 +1672,37 @@ ule_add_placeholders(ULE ule, XIDS xids) { ...@@ -1672,37 +1672,37 @@ ule_add_placeholders(ULE ule, XIDS xids) {
} }
} }
int uint64_t
ule_num_uxrs(ULE ule) { ule_num_uxrs(ULE ule) {
return ule->num_cuxrs + ule->num_puxrs; return ule->num_cuxrs + ule->num_puxrs;
} }
UXR UXR
ule_get_uxr(ULE ule, int ith) { ule_get_uxr(ULE ule, uint64_t ith) {
invariant(0 <= ith && ith < ule_num_uxrs(ule)); invariant(ith < ule_num_uxrs(ule));
return &ule->uxrs[ith]; return &ule->uxrs[ith];
} }
int uint32_t
ule_get_num_committed(ULE ule) { ule_get_num_committed(ULE ule) {
return ule->num_cuxrs; return ule->num_cuxrs;
} }
int uint32_t
ule_get_num_provisional(ULE ule) { ule_get_num_provisional(ULE ule) {
return ule->num_puxrs; return ule->num_puxrs;
} }
int int
ule_is_committed(ULE ule, int ith) { ule_is_committed(ULE ule, uint64_t ith) {
invariant(0 <= ith && ith < ule_num_uxrs(ule)); invariant(ith < ule_num_uxrs(ule));
return ith < (int) ule->num_cuxrs; return ith < ule->num_cuxrs;
} }
int int
ule_is_provisional(ULE ule, int ith) { ule_is_provisional(ULE ule, uint64_t ith) {
invariant(0 <= ith && ith < ule_num_uxrs(ule)); invariant(ith < ule_num_uxrs(ule));
return ith >= (int) ule->num_cuxrs; return ith >= ule->num_cuxrs;
} }
void * void *
......
...@@ -24,12 +24,12 @@ ULEHANDLE toku_ule_create(void * le_p); ...@@ -24,12 +24,12 @@ ULEHANDLE toku_ule_create(void * le_p);
void toku_ule_free(ULEHANDLE ule_p); void toku_ule_free(ULEHANDLE ule_p);
int ule_num_uxrs(ULEHANDLE ule); uint64_t ule_num_uxrs(ULEHANDLE ule);
int ule_get_num_committed(ULEHANDLE ule); uint32_t ule_get_num_committed(ULEHANDLE ule);
int ule_get_num_provisional(ULEHANDLE ule); uint32_t ule_get_num_provisional(ULEHANDLE ule);
UXRHANDLE ule_get_uxr(ULEHANDLE ule, int ith); UXRHANDLE ule_get_uxr(ULEHANDLE ule, uint64_t ith);
int ule_is_committed(ULEHANDLE ule, int ith); int ule_is_committed(ULEHANDLE ule, uint64_t ith);
int ule_is_provisional(ULEHANDLE ule, int ith); int ule_is_provisional(ULEHANDLE ule, uint64_t ith);
void *ule_get_key(ULEHANDLE ule); void *ule_get_key(ULEHANDLE ule);
uint32_t ule_get_keylen(ULEHANDLE ule); uint32_t ule_get_keylen(ULEHANDLE ule);
......
This diff is collapsed.
...@@ -168,18 +168,19 @@ put_callback(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_data, const DBT * ...@@ -168,18 +168,19 @@ put_callback(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_data, const DBT *
lazy_assert(0); lazy_assert(0);
} }
switch (dest_data->flags) { if (dest_data)
case 0: switch (dest_data->flags) {
lazy_assert(0); case 0:
break; lazy_assert(0);
case DB_DBT_REALLOC: break;
dest_data->data = toku_realloc(dest_data->data, src_key->size); case DB_DBT_REALLOC:
memcpy(dest_data->data, src_key->data, src_key->size); dest_data->data = toku_realloc(dest_data->data, src_key->size);
dest_data->size = src_key->size; memcpy(dest_data->data, src_key->data, src_key->size);
break; dest_data->size = src_key->size;
default: break;
lazy_assert(0); default:
} lazy_assert(0);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment