Handle object-oriented code/polymorphism correctly
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 732
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
There are several places in the code where there is potentially unsafe casting in order to implement object-oriented code and polymorphism. The correct way to handle this is to create virtual translation functions.
Implements correctly:
clockcache.c
Implements safely, but incorrectly (e.g. merge_advance should take a merge_iterator and there should be a virtual wrapper function which performs the cast):
merge.c
btree.c (btree_iterator)
laio.c
shard_log.c
splinter.c
Implements unsafely:
rc_allocator.c
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by studying the virtual translation approach already implemented in clockcache.c. Then audit merge.c, btree.c, laio.c, shard_log.c, splinter.c, and rc_allocator.c, with particular attention to merge_advance and btree_iterator; done means the unsafe casts are replaced with correctly typed virtual wrapper functions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100