Skip to content

Commit 317f1f8

Browse files
committed
Update and bug fix
1 parent 28e819c commit 317f1f8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void VMStructs::init_constants() {
235235
DECLARE_INT_CONSTANTS_DO(READ_CONSTANT)
236236
}
237237
}
238-
// Sepcial case
238+
// Special case
239239
_frame_entry_frame_call_wrapper_offset *= sizeof(uintptr_t);
240240

241241

@@ -287,9 +287,9 @@ void VMStructs::verify_offsets() {
287287
assert(var != field_type##_value);
288288
#define VERSION_FIELD_WITH_VERSION(var, field_type, min_ver, max_ver, names) \
289289
assert(hotspot_version < min_ver || hotspot_version > max_ver || var != field_type##_value);
290-
291290
DECLARE_TYPE_FILED_DO(DO_NOTHING, VERIFY_FIELD, VERSION_FIELD_WITH_VERSION, DO_NOTHING)
292-
#undef VERIFY_OFFSET_OR_ADDRESS
291+
#undef VERSION_FIELD_WITH_VERSION
292+
#undef VERIFY_FIELD
293293
#undef DO_NOTHING
294294
#undef offset_value
295295
#undef address_value
@@ -574,7 +574,7 @@ const void *VMStructs::findHeapUsageFunc() {
574574
}
575575
flag = VMFlag::find("UseZGC", {VMFlag::Type::Bool});
576576
if (flag != NULL && flag->get() && VM::hotspot_version() < 21) {
577-
// acessing this method in JDK 21 (generational ZGC) wil cause SIGSEGV
577+
// accessing this method in JDK 21 (generational ZGC) will cause SIGSEGV
578578
return _libjvm->findSymbol("_ZN14ZCollectedHeap12memory_usageEv");
579579
}
580580
return _libjvm->findSymbol("_ZN13CollectedHeap12memory_usageEv");
@@ -609,8 +609,8 @@ void JNICALL VMStructs::NativeMethodBind(jvmtiEnv *jvmti, JNIEnv *jni, jthread t
609609
tmpDelayed = (void **)malloc(tmpCounter * sizeof(void *) * 2);
610610
memcpy(tmpDelayed, delayed, tmpCounter * sizeof(void *) * 2);
611611
delayedCounter = 0;
612-
delayed = NULL;
613612
free(delayed);
613+
delayed = NULL;
614614
}
615615
_lock.unlock();
616616
// if there was a delayed list, we check it now, not blocking on the lock
@@ -623,7 +623,7 @@ void JNICALL VMStructs::NativeMethodBind(jvmtiEnv *jvmti, JNIEnv *jni, jthread t
623623
free(tmpDelayed);
624624
}
625625
} else {
626-
_lock.unlock();
626+
_lock.lock();
627627
if (delayed != NULL) {
628628
delayed[delayedCounter] = method;
629629
delayed[delayedCounter + 1] = address;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inline T* cast_to(const void* ptr) {
4949
#define MATCH_SYMBOLS(...) (const char*[]) { __VA_ARGS__, nullptr }
5050

5151
/**
52-
* This macro defines a counterpart of a JVM class, e.g. VMKass -> Klass.
52+
* This macro defines a counterpart of a JVM class, e.g. VMKlass -> Klass.
5353
* By the convention, we prefix the class name with 'VM' to avoid namespace collision
5454
* with JVM inside a debug session. E.g.
5555
* gdb > p this
@@ -273,7 +273,7 @@ typedef void* address;
273273
type_end()
274274

275275
/**
276-
* The follwing macros declare JVM constants that are exported by vmStructs
276+
* The following macros declare JVM constants that are exported by vmStructs
277277
* - constant defines a constant of a class
278278
*/
279279

0 commit comments

Comments
 (0)