Skip to content

Commit 45eb88a

Browse files
committed
Zing
1 parent b1d1eec commit 45eb88a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

ddprof-lib/src/main/cpp/vmStructs.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ void VMStructs::init_constants() {
264264
#ifdef DEBUG
265265
void VMStructs::verify_offsets() {
266266
// Hotspot only
267-
assert(VM::isHotspot());
267+
if (!VM::isHotspot()) {
268+
return;
269+
}
268270
int hotspot_version = VM::hotspot_version();
269271

270272
// Verify type sizes

ddprof-lib/src/main/cpp/vmStructs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ inline T* cast_to(const void* ptr) {
6868
public: \
6969
static uint64_t type_size() { return TYPE_SIZE_NAME(name); } \
7070
static name * cast(const void* ptr) { return cast_to<name>(ptr); } \
71+
static name * cast_raw(const void* ptr) { return (name *)ptr; } \
7172
static name * load_then_cast(const void* ptr) { \
7273
assert(ptr != nullptr); \
7374
return cast(*(const void**)ptr); }
@@ -700,7 +701,7 @@ DECLARE(VMThread)
700701
}
701702

702703
static VMThread* fromJavaThread(JNIEnv* env, jthread thread) {
703-
return VMThread::cast((const void*)env->GetLongField(thread, _eetop));
704+
return VMThread::cast_raw((const void*)env->GetLongField(thread, _eetop));
704705
}
705706

706707
static jlong javaThreadId(JNIEnv* env, jthread thread) {

0 commit comments

Comments
 (0)