Skip to content

Commit

Permalink
[Cleanup] cookie2traceable; cookies are no longer void*
Browse files Browse the repository at this point in the history
Change-Id: I6c8d865fc1203ce92cb753799420293924d2ebef
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/180859
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
trondn committed Oct 7, 2022
1 parent c495ccc commit 6e5bdc0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions engines/ep/src/trace_helpers.h
Expand Up @@ -12,10 +12,11 @@

#include "objectregistry.h"

#include <memcached/cookie_iface.h>
#include <memcached/tracer.h>

static inline cb::tracing::Traceable* cookie2traceable(const void* cc) {
return reinterpret_cast<cb::tracing::Traceable*>(const_cast<void*>(cc));
static inline cb::tracing::Traceable* cookie2traceable(const CookieIface* cc) {
return const_cast<CookieIface*>(cc);
}

/**
Expand All @@ -36,8 +37,8 @@ class ScopedTracer {
}
}

/// Constructor from Cookie (void*)
ScopedTracer(const void* cookie, cb::tracing::Code code)
/// Constructor from const CookieIface
ScopedTracer(const CookieIface* cookie, cb::tracing::Code code)
: ScopedTracer(*cookie2traceable(cookie), code) {
}

Expand Down Expand Up @@ -69,8 +70,8 @@ class TracerStopwatch {
: traceable(traceable), code(code) {
}

/// Constructor from Cookie (void*)
TracerStopwatch(const void* cookie, const cb::tracing::Code code)
/// Constructor from const CookieIface
TracerStopwatch(const CookieIface* cookie, const cb::tracing::Code code)
: TracerStopwatch(cookie2traceable(cookie), code) {
}

Expand Down

0 comments on commit 6e5bdc0

Please sign in to comment.