Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more C++ features #18

Merged
merged 28 commits into from Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fc5f8e5
Use more C++ features
kamahen May 20, 2023
1b5fe27
Use PlForeignContextPtr, unique_ptr for rocks_enum predicates
kamahen May 20, 2023
9aa78db
Use RAII for mutexes
kamahen May 20, 2023
8c1b081
Use std::map for alias_entries
kamahen May 20, 2023
ab07669
C++ style of enum
kamahen May 20, 2023
65cbb41
Add some debug info
kamahen May 20, 2023
fcedebe
Add alias test
kamahen May 21, 2023
8ff9155
dbref::pathname is now PlAtom, so dbref is unique
kamahen May 21, 2023
a6b43c1
rocks_close/1 with an anonymous handle doesn't throw an exception
kamahen Jun 1, 2023
505555f
Remove "once" option from rocks_open/3
kamahen Jun 1, 2023
63e03a7
Remove dbref::flags and use !db to test for DB not open
kamahen Jun 1, 2023
22af785
Add blob to rocks_error term
kamahen Jun 2, 2023
2c3a9bc
Simplify unification, rocks_close/1, and cleanup
kamahen Jun 4, 2023
f592d49
Merger keeps copy of some dbref fields instead of pointer to dbref
kamahen Jun 5, 2023
117aa16
Replace lazy filling in of lookup table entries by first-use PlAtom c…
kamahen Jun 5, 2023
81bf8e4
Preparing for C++ blob
kamahen Jun 6, 2023
7c9a4bd
Use C++ API for blobs
kamahen Jun 7, 2023
890875f
Version bump
kamahen Jun 7, 2023
0720723
Remove comments about PL_BLOB_UNIQUE - foreign.doc will be updated
kamahen Jun 10, 2023
2211852
Moved blob API code to SWI-cpp2.h
kamahen Jun 12, 2023
d45f9fe
Use improved blob interface
kamahen Jul 4, 2023
270bce5
Use new convenience macro for defining blobs
kamahen Jul 4, 2023
4e04dfe
PlBlob no longer uses a template
kamahen Jul 4, 2023
ca308ff
Put blob "vtable" functions into a class
kamahen Jul 5, 2023
d71b46b
Catch C++ exceptions in blob callbacks
kamahen Jul 13, 2023
2142533
Fix close and error handling; use new blob_unify w/unique_ptr
kamahen Aug 8, 2023
98a6e70
Replace PlForeignContextPtr by PlControl::context_unique_ptr
kamahen Aug 10, 2023
b20a406
Sync to rocksdb v8.3.2
kamahen Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
@@ -1,10 +1,9 @@
#COFLAGS=-gdwarf-2 -g3
# The following flags are the same as rocksdb uses, except that rocksdb also has -Werror
# and doesn't have the conversion flags in ADDED_CPPFLAGS
# TODO: Add -Werror
# TODO: Options that work with clang
ADDED_CPPFLAGS=-Wconversion -Warith-conversion -Wsign-conversion -Wfloat-conversion -Wno-unused-parameter
CPPFLAGS=-Wall -Wextra -Wsign-compare -Wshadow -Wunused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-invalid-offsetof $(ADDED_CPPFLAGS) -std=c++17 -O2 $(CFLAGS) $(COFLAGS) $(LDSOFLAGS) -Irocksdb/include

# For development, specify the following:
# ADDED_CPP_FLAGS= -Wsign-compare -Wshadow -Wunused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wno-invalid-offsetof -Wconversion -Warith-conversion -Wsign-conversion -Wfloat-conversion -Wno-unused-parameter -Wno-missing-field-initializers

CPPFLAGS=-Wall $(ADDED_CPPFLAGS) -std=c++17 -O2 $(CFLAGS) $(COFLAGS) $(LDSOFLAGS) -Irocksdb/include
LIBROCKSDB=rocksdb/librocksdb.a
ROCKSENV=ROCKSDB_DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1
# DEBUG_LEVEL=0 implies -O2 without assertions and debug code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ Should do the trick. Note that this clones RocksDB and builds it the way
we need the library. This requires significant disk space (1.4Gb) and
takes long (several minutes on a modern machine).

This code depends on version 2 of the `SWI-cpp.h` file that is part of
This code depends on version 2 of the `SWI-cpp2.h` file that is part of
SWI-Prolog version 9.1.0 and later.

#### Why are you not using the pre-built librocksdb?
Expand Down