Skip to content

Commit

Permalink
Switch to pandas labels
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg committed Aug 15, 2024
1 parent 3e691ae commit af92549
Show file tree
Hide file tree
Showing 10 changed files with 706 additions and 253 deletions.
2 changes: 1 addition & 1 deletion build_helper.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

cd native
bazel build -c dbg _meds_reader.so meds_reader_convert
bazel build -c opt _meds_reader.so meds_reader_convert
cd ..

rm -f src/meds_reader/_meds_reader* src/meds_reader/meds_reader_convert*
Expand Down
8 changes: 4 additions & 4 deletions native/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/create_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void sort_concatenate_shards(int i, const std::filesystem::path& root_path,
pointer += size;
}

pdqsort_branchless(std::begin(entries), std::end(entries));
pdqsort(std::begin(entries), std::end(entries));

data_file.run_with_file(shard, [&](std::ofstream& file) {
if (entries.size() > 0) {
Expand Down
22 changes: 17 additions & 5 deletions native/fast_shared_ptr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,31 @@ class fast_shared_ptr_object {

fast_shared_ptr<T> shared_from_this();

protected:
friend class fast_shared_ptr<T>;

void decref() {
counter--;
if (counter < 0) {
throw std::runtime_error("Counter is less than zero");
}

if (counter == 0) {
delete static_cast<T*>(this);
static_cast<T*>(this)->delete_self();
}
}

private:
void incref() {
counter++;
}

protected:
friend class fast_shared_ptr<T>;


void delete_self() {
delete static_cast<T*>(this);
}

size_t counter;
private:
};

template <typename T>
Expand Down
Loading

0 comments on commit af92549

Please sign in to comment.