Skip to content
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ INCLUDE = -I $(INCDIR) -I $(SRCDIR) -I $(SRCDIR)/platform_$(PLATFORM) -I $(TESTS

# use += here, so that extra flags can be provided via the environment

LD = $(CC)

CFLAGS += -D_GNU_SOURCE -ggdb -Wall -pthread -Wfatal-errors -Werror -Wvla
CFLAGS += -DXXH_STATIC_LINKING_ONLY -fPIC
CFLAGS += -DSPLINTERDB_PLATFORM_DIR=$(PLATFORM_DIR)
Expand Down Expand Up @@ -408,8 +410,12 @@ CLOCKCACHE_SYS = $(OBJDIR)/$(SRCDIR)/clockcache.o \
$(PLATFORM_IO_SYS)

BTREE_SYS = $(OBJDIR)/$(SRCDIR)/btree.o \
$(OBJDIR)/$(SRCDIR)/blob.o \
$(OBJDIR)/$(SRCDIR)/blob_build.o \
$(OBJDIR)/$(SRCDIR)/data_blob_build.o \
$(OBJDIR)/$(SRCDIR)/data_internal.o \
$(OBJDIR)/$(SRCDIR)/mini_allocator.o \
$(OBJDIR)/$(SRCDIR)/ondisk_ref.o \
$(CLOCKCACHE_SYS)

#################################################################
Expand Down
10 changes: 9 additions & 1 deletion include/splinterdb/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ typedef enum message_type {
*/
typedef struct message {
message_type type;
slice data;
// Internal: non-NULL means data is a blob descriptor.
void *cc;
slice data;
} message;

static inline message_type
Expand All @@ -70,6 +72,12 @@ message_length(message msg)
return slice_length(msg.data);
}

static inline _Bool
message_is_blob(message msg)
{
return msg.cc != NULL;
}

static inline const void *
message_data(message msg)
{
Expand Down
4 changes: 4 additions & 0 deletions src/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ typedef uint64 allocator_root_id;
*
* - PAGE_TYPE_LOG : struct shard_log_hdr{} + computed offsets
*
* - PAGE_TYPE_BLOB : raw user data (see blob.c)
*
* - PAGE_TYPE_SUPERBLOCK : struct trunk_super_block{}
* ----------------------------------------------------------------------------
*/
Expand All @@ -51,6 +53,7 @@ typedef enum page_type {
PAGE_TYPE_MEMTABLE,
PAGE_TYPE_FILTER,
PAGE_TYPE_LOG,
PAGE_TYPE_BLOB,
PAGE_TYPE_SUPERBLOCK,
PAGE_TYPE_MISC, // Used mainly as a testing hook, for cache access testing.
NUM_PAGE_TYPES,
Expand All @@ -62,6 +65,7 @@ static const char *const page_type_str[] = {"invalid",
"memtable",
"filter",
"log",
"blob",
"superblock",
"misc"};

Expand Down
Loading
Loading