Table of Contents

Method SetBits

Namespace
KZDev.PerfUtils
Assembly
KZDev.PerfUtils.dll

SetBits(ref int, int)

A thread-safe method to set a specific set of bits in a variable.

public static (int originalValue, int newValue) SetBits(ref int location1, int setBitsValue)

Parameters

location1 int

A variable containing the bits to set. The result is stored in this variable.

setBitsValue int

The value that holds the bits to set and store in location1

Returns

(int originalValue, int newValue)

A tuple containing the original value and the new value after the operation.

Remarks

This is a convenience method that uses the Or(ref int, int) operation to set the bits, and returns the original and new values.

SetBits(ref uint, uint)

A thread-safe method to set a specific set of bits in a variable.

public static (uint originalValue, uint newValue) SetBits(ref uint location1, uint setBitsValue)

Parameters

location1 uint

A variable containing the bits to set. The result is stored in this variable.

setBitsValue uint

The value that holds the bits to set and store in location1

Returns

(uint originalValue, uint newValue)

A tuple containing the original value and the new value after the operation.

Remarks

This is a convenience method that uses the Or(ref int, int) operation to set the bits, and returns the original and new values.

SetBits(ref long, long)

A thread-safe method to set a specific set of bits in a variable.

public static (long originalValue, long newValue) SetBits(ref long location1, long setBitsValue)

Parameters

location1 long

A variable containing the bits to set. The result is stored in this variable.

setBitsValue long

The value that holds the bits to set and store in location1

Returns

(long originalValue, long newValue)

A tuple containing the original value and the new value after the operation.

Remarks

This is a convenience method that uses the Or(ref int, int) operation to set the bits, and returns the original and new values.

SetBits(ref ulong, ulong)

A thread-safe method to set a specific set of bits in a variable.

public static (ulong originalValue, ulong newValue) SetBits(ref ulong location1, ulong setBitsValue)

Parameters

location1 ulong

A variable containing the bits to set. The result is stored in this variable.

setBitsValue ulong

The value that holds the bits to set and store in location1

Returns

(ulong originalValue, ulong newValue)

A tuple containing the original value and the new value after the operation.

Remarks

This is a convenience method that uses the Or(ref int, int) operation to set the bits, and returns the original and new values.