Git Product home page Git Product logo

cwisstable's Introduction

cwisstable.h - SwissTables for All

cwisstable is a single-header C11 port of the Abseil project's SwissTables. This project is intended to bring the proven performance and flexibility of SwissTables to C projects which cannot require a C++ compiler or for projects which otherwise struggle with dependency management.

The public API is currently in flux, as is test coverage, but the C programs in the examples directory illustrate portions of the API.

Code in this project follows the Google C++ Style Guide where applicable; variations due to C are described in STYLE.md.

Getting It

TL;DR: run ./unified.py cwisstable/*.h, grab cwisstable.h, and get cwissing.

There are two options for using this library: Bazel, or single-header.

Bazel support exists by virtue of that being how the tests and benchmarks are build and run. All development on cwisstable itself requires Bazel. Downstream projects may use git_repository to depend on this workspace; two build targets are available:

  • //:split is the "native" split form of the headers (i.e., as they are checked in).
  • //:unified is the generated unified header, which is functionality identical.

Most C projects use other build systems: Make, CMake, Autoconf, Meson, and artisanal shell scripts; expecting projects to fuss with Bazel is an accessibility barrier. This is the raison d-être: you generate the unified header, vendor it into your project, and never think about it again. Even generating the file doesn't require installing Bazel; all you need is Python:

git clone https://github.com/google/cwisstable.git && cd cwisstable
./unify.py

This will output a cwisstable.h file that you can vendor in; the checkout and generation step is only necessary for upgrading the header.

That said, if you're writing C++, this library is very much not for you. Please use https://github.com/abseil/abseil-cpp instead!

Using It

To use cwisstable, include cwisstable.h and use the code-generating macros to create a new map type:

#include "cwisstable.h"

CWISS_DECLARE_FLAT_HASHSET(MyIntSet, int);

int main(void) {
  MyIntSet set = MyIntSet_new(8);

  for (int i = 0; i < 8; ++i) {
    int val = i * i + 1;
    MyIntSet_insert(&set, &val);
  }

  int k = 4;
  assert(!MyIntSet_contains(&set, &k));
}

cwisstable/declare.h has a detailed description of these macros and their generated API.

cwisstable/policy.h describes how to use hash table policies to define more complex sets and maps. examples/stringmap.c shows this in action!

Compatibility Warnings

We don't version cwisstable.h; instead, users are expected to vendor the unified file into their projects and manually update it; cwisstable's distribution method (or, lack of one) is intended to eliminate all friction to its use in traditional C projects.

That said, we do not provide any kind of ABI or API stability from one revision to another that would allow cwisstable.h to appear in another library's public headers. You must not, under any circumstances, expose this header in your public headers. Doing so may clash with another project making the same mistake, and potentially destroy compile times due to the enormous number of inline functions generated in every translation unit.

Including cwisstable.h into a public header will also cause it to become part of your API, due to Hyrum's Law, even if our types do not appear in your interfaces. Such a mistake may be difficult to unwind, and we will not provide support for it.

The intended use of cwisstable.h is that it will either be included directly into your .c files, or a private .h file that declares common table types which is then includes in your .c files.


This is not an officially supported Google product.

cwisstable's People

Contributors

achernya avatar mcy avatar mumbleskates avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cwisstable's Issues

Clean up `cc_wrappers.h` and decide whether we want to expose a `raw_hash_set`-like API.

It may be worthwhile to implement a full-on C++ API for Cwisstable (coming full circle...) for ease of testing. Right now something like that is available but it's very janky.

It's an open question whether we want to make this part of the library's API; although the C core is the interesting part, the C++ API is might be useful for more than just testing (such as for folks that have C++ but can't pull in all of Abseil).

NEON support

There is a small block of SSE2/SSSE3-based SIMD in CWISS_Group that by all means should also be doable with NEON.

Allow emplacing values.

Right now the only way to insert into a set is via

static inline MySet_Insert MySet_insert(MySet* self, Value* val);

which performs a call to policy->copy_val. We should provide something similar to lazy_emplace that passes a callback:

static inline MySet_Insert MySet_emplace(MySet* self, void (*cb)(void* ctx, void* slot), void* ctx);

Build fails with clang

The tests fail to compile when using Clang.

In file included from examples/hashset.c:22:
In file included from ./cwisstable/declare.h:22:
./cwisstable/internal/raw_table.h:326:10: error: variable 'total_probe_length' set but not used [-Werror,-Wunused-but-set-variable]
  size_t total_probe_length = 0;
         ^
./cwisstable/internal/raw_table.h:378:10: error: variable 'total_probe_length' set but not used [-Werror,-Wunused-but-set-variable]
  size_t total_probe_length = 0;
         ^
$ cc --version
Ubuntu clang version 15.0.0-++20220206114023+bad1b7fbb0fe-1~exp1~20220206114123.276
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Clean up tests.

  • absl_raw_hash_set_test.cc is a copy of Abseil's tests for absl::raw_hash_set, which we've bodged to provide very basic unit tests. We should adapt these tests to more closely match cwisstable's API (with C++-based conveniences).
  • Add tests for various combinations of containers and types. E.g. {node,flat}_hash_{set,map} of {trivial,owning,pointer} types.

Write up a style guide

The code right now looks like a strange amalgamation of Google C++ with C idioms. We should write down some norms and practices of where we deviate from Google C++ for consistency.

Tests are failing on aarch64

Tests are failing on my raspberry pi 4.

widders@beepy ~/repos/cwisstable (main) $ lscpu
Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
Vendor ID:                       ARM
Model:                           3
Model name:                      Cortex-A72
Stepping:                        r0p3
CPU max MHz:                     1500.0000
CPU min MHz:                     600.0000
BogoMIPS:                        108.00
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Vulnerable
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm crc32 cpuid


widders@beepy ~/repos/cwisstable (main) $ bazel version
# bazel built from source at tag 4.2.2
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
Build label: 
Build target: bazel-out/aarch64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sat Jan 1 01:58:05 2022 (1641002285)
Build timestamp: 1641002285
Build timestamp as int: 1641002285


widders@beepy ~/repos/cwisstable (main) $ bazel test ...
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
INFO: Analyzed 5 targets (0 packages loaded, 0 targets configured).
INFO: Found 4 targets and 1 test target...
FAIL: //test:raw_hash_set_test (see /home/widders/.cache/bazel/_bazel_widders/6f71af31bac93520e423359343e718cb/execroot/__main__/bazel-out/aarch64-fastbuild/testlogs/test/raw_hash_set_test/test.log)
INFO: Elapsed time: 1.654s, Critical Path: 1.11s
INFO: 2 processes: 2 linux-sandbox.
INFO: Build completed, 1 test FAILED, 2 total actions
//test:raw_hash_set_test                                                 FAILED in 1.0s
  /home/widders/.cache/bazel/_bazel_widders/6f71af31bac93520e423359343e718cb/execroot/__main__/bazel-out/aarch64-fastbuild/testlogs/test/raw_hash_set_test/test.log

INFO: Build completed, 1 test FAILED, 2 total actions


widders@beepy ~/repos/cwisstable (main) $ cat /home/widders/.cache/bazel/_bazel_widders/6f71af31bac93520e423359343e718cb/execroot/__main__/bazel-out/aarch64-fastbuild/testlogs/test/raw_hash_set_test/test.log    
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //test:raw_hash_set_test                                              
-----------------------------------------------------------------------------              
Running main() from gmock_main.cc                                                          
[==========] Running 37 tests from 5 test suites.                                          
[----------] Global test environment set-up.
[----------] 3 tests from Util               
[ RUN      ] Util.NormalizeCapacity        
[       OK ] Util.NormalizeCapacity (0 ms) 
[ RUN      ] Util.GrowthAndCapacity        
[       OK ] Util.GrowthAndCapacity (68 ms)
[ RUN      ] Util.probe_seq                
test/absl_raw_hash_set_test.cc:118: Failure                                                
Value of: offsets                                                                          
Expected: has 8 elements where                                                             
element #0 is equal to 0,                                                                  
element #1 is equal to 16,                 
element #2 is equal to 48,                                                                 
element #3 is equal to 96,                 
element #4 is equal to 32,                                                                 
element #5 is equal to 112,                                                                
element #6 is equal to 80,                                                                 
element #7 is equal to 64                                                                  
  Actual: { 0, 8, 24, 48, 80, 120, 40, 96 }, whose element #1 doesn't match
test/absl_raw_hash_set_test.cc:121: Failure
Value of: offsets                                                                                                                                                                     
Expected: has 8 elements where                                                             
element #0 is equal to 0,                  
element #1 is equal to 16,        
element #2 is equal to 48,                                                                                                                                                            
element #3 is equal to 96,                                                                                                                                                            
element #4 is equal to 32,                                                                                                                                                            
element #5 is equal to 112,                                                                                                                                                           
element #6 is equal to 80,                                                                                                                                                            
element #7 is equal to 64                                                                                                                                                             
  Actual: { 0, 8, 24, 48, 80, 120, 40, 96 }, whose element #1 doesn't match                                                                                                           
[  FAILED  ] Util.probe_seq (0 ms)                                                         
[----------] 3 tests from Util (69 ms total)
                                             
[----------] 3 tests from BitMask                                                          
[ RUN      ] BitMask.Smoke                                                                 
[       OK ] BitMask.Smoke (0 ms)                                                          
[ RUN      ] BitMask.WithShift            
[       OK ] BitMask.WithShift (0 ms)                                                                                                                                                 
[ RUN      ] BitMask.LeadingTrailing
[       OK ] BitMask.LeadingTrailing (0 ms)                                                
[----------] 3 tests from BitMask (0 ms total)                                             
                                                                                           
[----------] 5 tests from Group                                                            
[ RUN      ] Group.EmptyGroup                                                                                                                                                         
[       OK ] Group.EmptyGroup (0 ms)         
[ RUN      ] Group.Match                                                                   
[       OK ] Group.Match (0 ms)                                                                                                                                                       
[ RUN      ] Group.MatchEmpty
[       OK ] Group.MatchEmpty (0 ms)       
[ RUN      ] Group.MatchEmptyOrDeleted                                                     
[       OK ] Group.MatchEmptyOrDeleted (0 ms)                                              
[ RUN      ] Group.CountLeadingEmptyOrDeleted                                              
[       OK ] Group.CountLeadingEmptyOrDeleted (0 ms)                                       
[----------] 5 tests from Group (0 ms total)
                                             
[----------] 1 test from Batch             
[ RUN      ] Batch.DropDeletes             
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:         
  ctrl[i]                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
1 2                                                                                        
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:                                                         
  ctrl[i]                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                
2 -2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:         
  ctrl[i]                                                                                                                                                                             
    Which is: '\x2' (2)                                                                    
  expected                                 
    Which is: '\xFE' (-2)         
3 2                                                                                                                                                                                   
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                                                                                                             
    Which is: '\x1' (1)                                                                                                                                                               
  expected                                                                                                                                                                            
    Which is: '\xFE' (-2)                                                                                                                                                             
5 1                                                                                        
test/absl_raw_hash_set_test.cc:256: Failure 
Expected equality of these values:           
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)               
6 -2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                                                                                                           
9 -2                                         
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                    
    Which is: '\x2' (2)                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
10 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:          
  ctrl[i]                                    
    Which is: '\x1' (1)                    
  expected                                 
    Which is: '\xFE' (-2)                  
12 1                                       
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                
13 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
15 2                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                         
  ctrl[i]                                  
    Which is: '\x2' (2)           
  expected                                                                                                                                                                            
    Which is: '\xFE' (-2)                                                                                                                                                             
17 2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                                                                                                             
    Which is: '\x1' (1)                                                                                                                                                               
  expected                                                                                 
    Which is: '\xFE' (-2)                   
19 1                                         
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                 
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                
20 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                                                                                                               
  expected                                   
    Which is: '\xFE' (-2)                                                                  
22 2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                
23 -2                                       
test/absl_raw_hash_set_test.cc:256: Failure  
Expected equality of these values:         
  ctrl[i]                                  
    Which is: '\x1' (1)                    
  expected                                 
    Which is: '\xFE' (-2)                  
26 1                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                  
  expected                                                                                 
    Which is: '\x80' (-128)                
27 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                 
    Which is: '\xFE' (-2)                                                                                                                                                             
29 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:
  ctrl[i]                                                                                                                                                                             
    Which is: '\xFE' (-2)                                                                                                                                                             
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                                                                                                                                                           
30 -2                                                                                                                                                                                 
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                     
  expected                                   
    Which is: '\xFE' (-2)                                                                  
31 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:        
  ctrl[i]                                                                                                                                                                             
    Which is: '\x1' (1)                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
33 1                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                    
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                
34 -2                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                  
    Which is: '\xFE' (-2)                    
36 2                                       
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:         
  ctrl[i]                                  
    Which is: '\xFE' (-2)                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                
37 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
38 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                  
    Which is: '\xFE' (-2)                                                                                                                                                             
  expected                                                                                 
    Which is: '\x80' (-128)                
41 -2                             
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                                                                                                             
    Which is: '\x2' (2)                                                                                                                                                               
  expected                                                                                                                                                                            
    Which is: '\xFE' (-2)                                                                                                                                                             
43 2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:          
  ctrl[i]                                    
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                
44 -2                                     
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
45 2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure  
Expected equality of these values:                                                         
  ctrl[i]                                                                                                                                                                             
    Which is: '\x1' (1)                    
  expected                                 
    Which is: '\xFE' (-2)                                                                  
47 1                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                   
    Which is: '\x2' (2)                      
  expected                                 
    Which is: '\xFE' (-2)                  
50 2                                       
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                 
    Which is: '\x80' (-128)                                                                
51 -2                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
52 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                  
    Which is: '\x1' (1)                    
  expected                        
    Which is: '\xFE' (-2)                                                                                                                                                             
54 1                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                                                                                                             
    Which is: '\xFE' (-2)                                                                                                                                                             
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                                                                
55 -2                                       
test/absl_raw_hash_set_test.cc:256: Failure  
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                
    Which is: '\xFE' (-2)                                                                                                                                                             
57 2                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                  
58 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:         
  ctrl[i]                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                                                                  
59 2                                                                                       
test/absl_raw_hash_set_test.cc:256: Failure 
Expected equality of these values:           
  ctrl[i]                                  
    Which is: '\x1' (1)                    
  expected                                 
    Which is: '\xFE' (-2)                  
61 1                                       
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\xFE' (-2)                                                                  
  expected                                 
    Which is: '\x80' (-128)                                                                
62 -2                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                  
    Which is: '\x2' (2)                                                                    
  expected                                                                                 
    Which is: '\xFE' (-2)                  
65 -2                                                                                                                                                                                 
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:         
  ctrl[i]                         
    Which is: '\xFE' (-2)                                                                                                                                                             
  expected                                                                                                                                                                            
    Which is: '\x80' (-128)                                                                                                                                                           
66 2                                                                                                                                                                                  
test/absl_raw_hash_set_test.cc:256: Failure                                                                                                                                           
Expected equality of these values:                                                                                                                                                    
  ctrl[i]                                                                                                                                                                             
    Which is: '\x2' (2)                                                                    
  expected                                  
    Which is: '\xFE' (-2)                    
67 -128                                                                                    
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                 
    Which is: '\x1' (1)                                                                                                                                                               
  expected                                 
    Which is: '\xFE' (-2)                                                                  
69 -2                                                                                      
test/absl_raw_hash_set_test.cc:256: Failure                                                
Expected equality of these values:                                                         
  ctrl[i]                                                                                                                                                                             
    Which is: '\xFE' (-2)                    
  expected                                                                                 
    Which is: '\x80' (-128)                                                                                                                                                           
70 -128                                    
[  FAILED  ] Batch.DropDeletes (4 ms)      
[----------] 1 test from Batch (4 ms total)                                                                                                                                           
                                                                                           
[----------] 25 tests from Table           
[ RUN      ] Table.Empty          
[       OK ] Table.Empty (0 ms)                                                                                                                                                       
[ RUN      ] Table.LookupEmpty                                                                                                                                                        
[       OK ] Table.LookupEmpty (0 ms)                                                                                                                                                 
[ RUN      ] Table.Insert1                                                                                                                                                            
[       OK ] Table.Insert1 (0 ms)                                                                                                                                                     
[ RUN      ] Table.Insert2                                                                                                                                                            
[       OK ] Table.Insert2 (0 ms)                                                                                                                                                     
[ RUN      ] Table.InsertCollision                                                         
[       OK ] Table.InsertCollision (0 ms)   
[ RUN      ] Table.InsertCollisionAndFindAfterDelete
[       OK ] Table.InsertCollisionAndFindAfterDelete (0 ms)                                
[ RUN      ] Table.InsertWithinCapacity                                                    
[       OK ] Table.InsertWithinCapacity (0 ms)                                             
[ RUN      ] Table.ContainsEmpty          
[       OK ] Table.ContainsEmpty (0 ms)                                                                                                                                               
[ RUN      ] Table.Contains1               
[       OK ] Table.Contains1 (0 ms)                                                        
[ RUN      ] Table.Contains2                                                               
[       OK ] Table.Contains2 (0 ms)                                                        
[ RUN      ] Table.RehashWithNoResize                                                      
[       OK ] Table.RehashWithNoResize (24 ms)                                                                                                                                         
[ RUN      ] Table.InsertEraseStressTest     
CWISS_CHECK failed at ./cwisstable.h:1310                                                  
full table!                                                                                                                                                                           

Possible Misreference in README.md

Hi,

I was building this code for a personal project when I noticed a discrepancy in the build instructions from the Getting It section of the README. The body provides the correct build instructions:

git clone https://github.com/google/cwisstable.git && cd cwisstable 
./unify.py

but the TLDR at the top says to run ./unified.py cwisstable/*.h, which seems to be a typo because there is no unified.py in the repository. I think they meant./unify.py cwisstable/*.h. If this is a mistake, I would be happy to make the amend and submit the pull request.

Add documentation comments to `cwisstable.h`

The main file, cwisstable.h, should have very detailed documentation, references to the equivalent files in Abseil, the Swiss Table design doc, other things.

  • Top-of-file comment.
  • What define-based interface do we expose?
  • Which APIs are public?
  • Comment explaining policies.
  • Comment explaining generated APIs from CWISS_DECLARE_* macros.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.