Merge pull request #101 from nitingupta910/upstream

Fix new value length in partial_merge_callback
master
Tyler Neely 8 years ago committed by GitHub
commit 3310bc669b
  1. 2
      src/merge_operator.rs

@ -119,7 +119,7 @@ pub unsafe extern "C" fn partial_merge_callback(raw_cb: *mut c_void,
// TODO(tan) investigate zero-copy techniques to improve performance
let buf = libc::malloc(result.len() as size_t);
assert!(!buf.is_null());
*new_value_length = 1 as size_t;
*new_value_length = result.len() as size_t;
*success = 1 as u8;
ptr::copy(result.as_ptr() as *mut c_void, &mut *buf, result.len());
buf as *mut c_char

Loading…
Cancel
Save