Typo in MMgc/WriteBarrier.h

VERIFIED FIXED

Status

Tamarin
Garbage Collection (mmGC)
VERIFIED FIXED
11 years ago
9 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
Created attachment 282474 [details] [diff] [review]
v1

The || here should be &&, right?

		T set(const T tNew)
		{
			if(t != tNew || tNew != 0)
				GC::WriteBarrier(this, (const void*)tNew);
			else
				t = tNew;
			return tNew;
		}

The typo doesn't cause any problems, but it looks like this code doesn't prevent the call to GC::WriteBarrier as often as it's intended to.
Attachment #282474 - Flags: review?(treilly)

Comment 1

11 years ago
Comment on attachment 282474 [details] [diff] [review]
v1

looks fine, plus, if t == tNew then the WB could be a no-op.  not sure if the extra branching is worth it.
Attachment #282474 - Flags: review+

Updated

11 years ago
Attachment #282474 - Flags: review?(treilly) → review+
(Reporter)

Comment 2

11 years ago
Pushed changeset d65a6b20f353 to tamarin-central.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

9 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.