Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# https://editorconfig.org/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxxhash-dev libaio-dev libconfig-dev gcc clang-16 clang-format-16
packages: libxxhash-dev libaio-dev libconfig-dev gcc clang-19 clang-format-19
- name: format-check
run: ./format-check.sh

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
root-reserve-mb: 2048
swap-size-mb: 1
remove-dotnet: true
remove-android: true
Expand All @@ -88,6 +88,6 @@ jobs:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxxhash-dev libaio-dev libconfig-dev gcc clang-16 clang-format-16
packages: libxxhash-dev libaio-dev libconfig-dev gcc clang-19 clang-format-19
- name: make ${{ matrix.target }}
run: make ${{ matrix.target }}
run: pwd; make ${{ matrix.target }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Source for the image
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build-env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Source for the image
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.run-env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Source for the image
Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

.DEFAULT_GOAL := all
Expand Down Expand Up @@ -387,10 +387,16 @@ $(foreach unit,$(UNIT_TESTBINS),$(eval $(call unit_test_self_dependency,$(unit))
#
# These will need to be fleshed out for filters, io subsystem, trunk,
# etc. as we create mini unit test executables for those subsystems.
PLATFORM_SYS = $(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform.o \
PLATFORM_SYS = $(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_assert.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_buffer.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_condvar.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_heap.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_log.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_mutex.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_threads.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/shmem.o

PLATFORM_IO_SYS = $(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/laio.o
PLATFORM_IO_SYS = $(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/platform_io.o \
$(OBJDIR)/$(SRCDIR)/$(PLATFORM_DIR)/laio.o

UTIL_SYS = $(OBJDIR)/$(SRCDIR)/util.o $(PLATFORM_SYS)

Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 VMware, Inc.
Copyright 2021-2026 VMware, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ci/apply-pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Reconfigure the Concourse CI pipeline for this project.
Expand Down
2 changes: 1 addition & 1 deletion ci/jobs.lib.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2018-2021 VMware, Inc.
#! Copyright 2018-2026 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0

#@ load("@ytt:template", "template")
Expand Down
2 changes: 1 addition & 1 deletion ci/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2018-2021 VMware, Inc.
#! Copyright 2018-2026 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0

#! A ytt template for our Concourse CI pipeline
Expand Down
2 changes: 1 addition & 1 deletion ci/resources.lib.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2018-2021 VMware, Inc.
#! Copyright 2018-2026 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0

#@ load("@ytt:template", "template")
Expand Down
2 changes: 1 addition & 1 deletion ci/sequences.lib.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2018-2021 VMware, Inc.
#! Copyright 2018-2026 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0

#@ load("steps.lib.yml",
Expand Down
2 changes: 1 addition & 1 deletion ci/steps.lib.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2018-2021 VMware, Inc.
#! Copyright 2018-2026 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0

---
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/pr-check-shell-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Lints and formats any shell scripts changed by a PR
Expand Down
2 changes: 1 addition & 1 deletion default.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

##############################
Expand Down
4 changes: 2 additions & 2 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ To integrate SplinterDB into another application, see [Usage](usage.md).
Builds are known to work on Ubuntu using recent versions of GCC and Clang.

### Tooling
In CI, we test against GCC 13 and Clang 16.
In CI, we test against GCC 13 and Clang 19.

We use `clang-format-16` for code formatting.
We use `clang-format-19` for code formatting.

### Full build
Here are the steps to do a full-build of the library, run smoke tests, and to install the shared libraries:
Expand Down
4 changes: 2 additions & 2 deletions docs/site/content/docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ To integrate SplinterDB into another application, see [Usage](usage.md).
Builds are known to work on Ubuntu using recent versions of GCC and Clang.

### Tooling
In CI, we test against GCC 13 and Clang 16.
In CI, we test against GCC 13 and Clang 19.

We use `clang-format-16` for code formatting.
We use `clang-format-19` for code formatting.

### Full build
Here are the steps to do a full-build of the library, run smoke tests, and to install the shared libraries:
Expand Down
4 changes: 2 additions & 2 deletions docs/site/content/docs/v0.0.1/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ To integrate SplinterDB into another application, see [Usage](usage.md).
Builds are known to work on Ubuntu using recent versions of GCC and Clang.

### Tooling
In CI, we test against GCC 13 and Clang 16.
In CI, we test against GCC 13 and Clang 19.

We use `clang-format-16` for code formatting.
We use `clang-format-19` for code formatting.

### Full build
Here are the steps to do a full-build of the library, run smoke tests, and to install the shared libraries:
Expand Down
2 changes: 1 addition & 1 deletion examples/splinterdb_custom_ipv4_addr_sortcmp_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 VMware, Inc.
// Copyright 2022-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down
2 changes: 1 addition & 1 deletion examples/splinterdb_intro_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 VMware, Inc.
// Copyright 2022-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
/*
* SplinterDB "Hello World" example program. Demonstrate use of:
Expand Down
2 changes: 1 addition & 1 deletion examples/splinterdb_iterators_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 VMware, Inc.
// Copyright 2022-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down
2 changes: 1 addition & 1 deletion examples/splinterdb_wide_values_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 VMware, Inc.
// Copyright 2022-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down
4 changes: 2 additions & 2 deletions format-check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2018-2022 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# Checks that C source files follow our formatting conventions
Expand All @@ -9,7 +9,7 @@ set -eu -o pipefail

# different tool versions yield different results
# so we standardize on this version
TOOL="clang-format-16"
TOOL="clang-format-19"

# Check if TOOL exists
if ! command -v "$TOOL" &> /dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion include/splinterdb/data.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down
9 changes: 3 additions & 6 deletions include/splinterdb/default_data_config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

// A default data_config suitable for simple key/value applications
Expand All @@ -7,14 +7,11 @@
// This data_config does not support blind mutation operations, except
// plain overwrites of values.

#ifndef _SPLINTERDB_DEFAULT_DATA_CONFIG_H_
#define _SPLINTERDB_DEFAULT_DATA_CONFIG_H_
#pragma once

#include "splinterdb/data.h"
#include "data.h"

void
default_data_config_init(const uint64 max_key_size, // IN
data_config *out_cfg // OUT
);

#endif // _SPLINTERDB_DEFAULT_DATA_CONFIG_H_
25 changes: 24 additions & 1 deletion include/splinterdb/platform_linux/public_platform.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down Expand Up @@ -43,6 +43,8 @@ typedef uint64_t uint64;
typedef uint64 timestamp;
typedef uint64 threadid;

typedef int32 bool32;

#include <assert.h>
static_assert(sizeof(int8) == 1, "incorrect type");
static_assert(sizeof(uint8) == 1, "incorrect type");
Expand Down Expand Up @@ -74,3 +76,24 @@ typedef FILE platform_log_handle;
void
platform_set_log_streams(platform_log_handle *info_stream,
platform_log_handle *error_stream);

// Register the current thread so that it can be used with splinterdb.
//
// Any thread that uses a splinterdb must first be registered with it.
//
// The only exception is the initial thread which called create or open,
// as that thread is implicitly registered. Re-registering it is an error.
//
// A thread should not be registered more than once; that is an error.
//
// Note: There is currently a limit of MAX_THREADS registered at a given time
//
// Returns 0 on success, -1 on error.
int
platform_register_thread(void);

// Deregister the current thread.
//
// Call this function before exiting a registered thread.
void
platform_deregister_thread(void);
2 changes: 1 addition & 1 deletion include/splinterdb/public_platform.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand Down
4 changes: 2 additions & 2 deletions include/splinterdb/public_util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

#pragma once
Expand All @@ -25,7 +25,7 @@ typedef struct slice {
} slice;

#define NULL_SLICE ((slice){.length = 0, .data = NULL})
#define INVALID_SLICE ((slice){.length = (uint64)-1, .data = NULL})
#define INVALID_SLICE ((slice){.length = (uint64) - 1, .data = NULL})

static inline _Bool
slice_is_null(const slice b)
Expand Down
37 changes: 7 additions & 30 deletions include/splinterdb/splinterdb.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2021 VMware, Inc.
// Copyright 2018-2026 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

/*
Expand All @@ -8,12 +8,15 @@
*
* A data_config must be provided at the time of create/open.
* See default_data_config.h for a basic reference implementation.
*
* Each thread must call splinterdb_register_thread() before making any calls to
* SplinterDB. Each thread must call splinterdb_deregister_thread() before
* exiting.
*/

#ifndef _SPLINTERDB_H_
#define _SPLINTERDB_H_
#pragma once

#include "splinterdb/data.h"
#include "data.h"

// Get a version string for this build of SplinterDB
// Currently a git tag
Expand Down Expand Up @@ -177,30 +180,6 @@ splinterdb_open(const splinterdb_config *cfg, splinterdb **kvs);
void
splinterdb_close(splinterdb **kvs);

// Register the current thread so that it can be used with splinterdb.
// This causes scratch space to be allocated for the thread.
//
// Any thread that uses a splinterdb must first be registered with it.
//
// The only exception is the initial thread which called create or open,
// as that thread is implicitly registered. Re-registering it will leak memory.
//
// A thread should not be registered more than once; that would leak memory.
//
// splinterdb_close will use scratch space, so the thread that calls it must
// have been registered (or implicitly registered by being the initial thread).
//
// Note: There is currently a limit of MAX_THREADS registered at a given time
void
splinterdb_register_thread(splinterdb *kvs);

// Deregister the current thread and free its scratch space.
//
// Call this function before exiting a registered thread.
// Otherwise, you'll leak memory.
void
splinterdb_deregister_thread(splinterdb *kvs);

// Insert a key and value.
// Relies on data_config->encode_message
int
Expand Down Expand Up @@ -420,5 +399,3 @@ splinterdb_stats_print_lookup(const splinterdb *kvs);

void
splinterdb_stats_reset(splinterdb *kvs);

#endif // _SPLINTERDB_H_
2 changes: 1 addition & 1 deletion scripts/compute_amp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -x

# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

dir=$1
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

cat "$@" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/config_reader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2018-2021 VMware, Inc.
# Copyright 2018-2026 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0


Expand Down
Loading
Loading