Skip to content

Commit 2029603

Browse files
committed
[UR] Initialize RefCount with 0, not with 1
Initialize RefCount with 0, not with 1. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent da0da2b commit 2029603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unified-runtime/source/common/ur_ref_count.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ namespace ur {
1818

1919
class RefCount {
2020
public:
21-
RefCount(uint32_t count = 1) : Count(count) {}
21+
RefCount(uint32_t count = 0) : Count(count) {}
2222
RefCount(const RefCount &) = delete;
2323
RefCount &operator=(const RefCount &) = delete;
2424

2525
uint32_t getCount() const noexcept { return Count.load(); }
2626
uint32_t retain() { return ++Count; }
2727
bool release() { return --Count == 0; }
28-
void reset(uint32_t value = 1) { Count = value; }
28+
void reset(uint32_t value = 0) { Count = value; }
2929

3030
private:
3131
std::atomic_uint32_t Count;

0 commit comments

Comments
 (0)