License compliances, memory-streams, posix compilation, BNode prefix, exception safety #285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This is a set of contributions that I made as requested by the company/project I work for.
The library is being used in an embedded system, so requirements are strict when it comes to exception and memory handling, and some of the commits target this particular aspect, although they do not cover the whole codebase.
Furthermore, the repository has conflicting licenses which we cannot use and had to be filtered out, such as: libcds, hdt-it
Summary of the changes introduced:
madvise
function being used inlibhdt/src/util/filemap.cpp
was changed toposix_madvise
due to compilation errors.posix_madvise
should be the actual posix-enabled generic method.libhdt/src/sequence/LogSequence.cpp
where we hadHAVE_CSD
instead ofHAVE_CDS
. Added sanity checks to gracefully close and clean-up resources for open file handles.HDTManager
to useunique_ptr
'sstd::unique_ptr
inlibhdt/src/hdt/HDTManager.cpp
to remove manual heap-allocation vianew
keyword in that layer. Deeper layers of the library still use the old new-allocator. Build file requirements for C++ version was bumped fromC+11
toC+14
to havestd::unique_ptr
available.-o "bnode.prefix=xxx"
.std::map::at()
method and adds safety checks to prevent exceptions being thrown when keyword is not found.libcds
andhdt-it
from the repository.hdt-it
has licenseGPL2
andlibcds
has licenseGPL2.1
, whilelibhdt
has licenseLGPL 2.1
.libhdt
works regardless of the presence of these folders. Building with or withoutlibcds
has shown absolutely no difference in our use-case, as all the required functionality is already embedded inlibhdt
.libhdt
andlibcds/hdt-it
also have different, conflicting licenses.HDTSpecification::getOrEmpty
and replaced it withstd::map::find
for safer error handling. Removed the exception fromAdjancencyList::binSearch
dead-end when the algorithm would not find the element, and replaced it with safer error handling logic.Looking forward for some feedback and how to integrate these changes into your mainline and, if not the mainline, then a secondary branch.