vmware / vmware/splinterdb

Handle object-oriented code/polymorphism correctly

Open
#125 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.