Skip to content

Commit 1edef79

Browse files
committed
cpp: remove timestamp methods from src/
I was really curious why these methods were not defined in `testing_unimplemented`. The testing binary linking should fail. Well... I found out that they are defined in src/, where we still have a cpp implementation of the timestamp generators. Note: While having both cpp and rust implementations, the linker did not complain, and happily linked the test binary even though there are duplicate definitions of timestamp_gen methods. It seems that linker picked up the cpp implementations. Why? The test causes segfault when calling `cass_cluster_set_timestamp_gen` when we try to clone an Arc. It means that pointer `cass_timestamp_gen_server_side_new` does not originate from Arc allocation - this suggests that the origin of the pointer is different (created by cpp API).
1 parent 3acb09e commit 1edef79

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/timestamp_generator.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@
2222

2323
using namespace datastax::internal::core;
2424

25-
extern "C" {
26-
27-
CassTimestampGen* cass_timestamp_gen_server_side_new() {
28-
TimestampGenerator* timestamp_gen = new ServerSideTimestampGenerator();
29-
timestamp_gen->inc_ref();
30-
return CassTimestampGen::to(timestamp_gen);
31-
}
32-
33-
CassTimestampGen* cass_timestamp_gen_monotonic_new() {
34-
TimestampGenerator* timestamp_gen = new MonotonicTimestampGenerator();
35-
timestamp_gen->inc_ref();
36-
return CassTimestampGen::to(timestamp_gen);
37-
}
38-
39-
CassTimestampGen* cass_timestamp_gen_monotonic_new_with_settings(int64_t warning_threshold_us,
40-
int64_t warning_interval_ms) {
41-
TimestampGenerator* timestamp_gen =
42-
new MonotonicTimestampGenerator(warning_threshold_us, warning_interval_ms);
43-
timestamp_gen->inc_ref();
44-
return CassTimestampGen::to(timestamp_gen);
45-
}
46-
47-
void cass_timestamp_gen_free(CassTimestampGen* timestamp_gen) { timestamp_gen->dec_ref(); }
48-
49-
} // extern "C"
50-
5125
int64_t MonotonicTimestampGenerator::next() {
5226
while (true) {
5327
int64_t last = last_.load();

0 commit comments

Comments
 (0)