@@ -35,7 +35,7 @@ inline void send_allocation_sample(const Klass* klass, int64_t allocated_bytes)
35
35
assert (allocated_bytes > 0 , " invariant" );
36
36
EventObjectAllocationSample event;
37
37
if (event.should_commit ()) {
38
- const size_t weight = allocated_bytes - _last_allocated_bytes;
38
+ const int64_t weight = allocated_bytes - _last_allocated_bytes;
39
39
assert (weight > 0 , " invariant" );
40
40
event.set_objectClass (klass);
41
41
event.set_weight (weight);
@@ -48,7 +48,7 @@ inline bool send_allocation_sample_with_result(const Klass* klass, int64_t alloc
48
48
assert (allocated_bytes > 0 , " invariant" );
49
49
EventObjectAllocationSample event;
50
50
if (event.should_commit ()) {
51
- const size_t weight = allocated_bytes - _last_allocated_bytes;
51
+ const int64_t weight = allocated_bytes - _last_allocated_bytes;
52
52
assert (weight > 0 , " invariant" );
53
53
event.set_objectClass (klass);
54
54
event.set_weight (weight);
@@ -59,11 +59,11 @@ inline bool send_allocation_sample_with_result(const Klass* klass, int64_t alloc
59
59
return false ;
60
60
}
61
61
62
- inline intptr_t estimate_tlab_size_bytes (Thread* thread) {
62
+ inline int64_t estimate_tlab_size_bytes (Thread* thread) {
63
63
const size_t desired_tlab_size_bytes = thread->tlab ().desired_size () * HeapWordSize;
64
64
const size_t alignment_reserve_bytes = thread->tlab ().alignment_reserve_in_bytes ();
65
65
assert (desired_tlab_size_bytes > alignment_reserve_bytes, " invariant" );
66
- return static_cast <intptr_t >(desired_tlab_size_bytes - alignment_reserve_bytes);
66
+ return static_cast <int64_t >(desired_tlab_size_bytes - alignment_reserve_bytes);
67
67
}
68
68
69
69
inline int64_t load_allocated_bytes (Thread* thread) {
@@ -81,14 +81,14 @@ inline int64_t load_allocated_bytes(Thread* thread) {
81
81
82
82
// To avoid large objects from being undersampled compared to the regular TLAB samples,
83
83
// the data amount is normalized as if it was a TLAB, giving a number of TLAB sampling attempts to the large object.
84
- static void normalize_as_tlab_and_send_allocation_samples (const Klass* klass, intptr_t obj_alloc_size_bytes, Thread* thread) {
84
+ static void normalize_as_tlab_and_send_allocation_samples (const Klass* klass, int64_t obj_alloc_size_bytes, Thread* thread) {
85
85
const int64_t allocated_bytes = load_allocated_bytes (thread);
86
86
assert (allocated_bytes > 0 , " invariant" ); // obj_alloc_size_bytes is already attributed to allocated_bytes at this point.
87
87
if (!UseTLAB) {
88
88
send_allocation_sample (klass, allocated_bytes);
89
89
return ;
90
90
}
91
- const intptr_t tlab_size_bytes = estimate_tlab_size_bytes (thread);
91
+ const int64_t tlab_size_bytes = estimate_tlab_size_bytes (thread);
92
92
if (allocated_bytes - _last_allocated_bytes < tlab_size_bytes) {
93
93
return ;
94
94
}
@@ -103,7 +103,7 @@ static void normalize_as_tlab_and_send_allocation_samples(const Klass* klass, in
103
103
104
104
void JfrObjectAllocationSample::send_event (const Klass* klass, size_t alloc_size, bool outside_tlab, Thread* thread) {
105
105
if (outside_tlab) {
106
- normalize_as_tlab_and_send_allocation_samples (klass, static_cast <intptr_t >(alloc_size), thread);
106
+ normalize_as_tlab_and_send_allocation_samples (klass, static_cast <int64_t >(alloc_size), thread);
107
107
return ;
108
108
}
109
109
const int64_t allocated_bytes = load_allocated_bytes (thread);
0 commit comments