facebook / facebook/rocksdb

C API: Differences in freeing result values between merge operator and compaction filter

Open
#6,624 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

> Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

### Expected behavior
The C API frees the resulting `tmp_new_value` within `FullMergeV2` and `PartialMergeMulti`:
https://github.com/facebook/rocksdb/blob/e6f86cfb36c66bb912ec278007e4622e4529c567/db/c.cc#L366-L376

### Actual behavior
The C API does not free `c_new_value` in calls to `Filter`, however: https://github.com/facebook/rocksdb/blob/e6f86cfb36c66bb912ec278007e4622e4529c567/db/c.cc#L215-L228

Is it expected that users of the C API manage the memory for the `c_new_value`, or can `Filter` be updated to similarly free `c_new_value` after it is assigned to `new_value`?
I'd be happy to work on any required changes.

### Steps to reproduce the behavior

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.