Skip to content

Commit 26e98b5

Browse files
Merge pull request #1084 from igchor/fix_windows_critnib
[UR] Fix critnib on windows
2 parents 54aff86 + ef109b2 commit 26e98b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/common/unified_malloc_framework/src/critnib/critnib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
#define DELETED_LIFE 16
8282

8383
#define SLICE 4
84-
#define NIB ((1UL << SLICE) - 1)
84+
#define NIB ((1ULL << SLICE) - 1)
8585
#define SLNODES (1 << SLICE)
8686

8787
typedef uintptr_t word;
@@ -156,7 +156,7 @@ static inline bool is_leaf(struct critnib_node *n) { return (word)n & 1; }
156156
* internal: to_leaf -- untag a leaf pointer
157157
*/
158158
static inline struct critnib_leaf *to_leaf(struct critnib_node *n) {
159-
return (void *)((word)n & ~1UL);
159+
return (void *)((word)n & ~1ULL);
160160
}
161161

162162
/*

source/common/unified_malloc_framework/src/utils/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static __inline unsigned char util_mssb_index(long long value) {
4343
// There is no good way to do atomic_load on windows...
4444
#define util_atomic_load_acquire(object, dest) \
4545
do { \
46-
*dest = InterlockedOr64Acquire((LONG64 volatile *)dest, 0); \
46+
*dest = InterlockedOr64Acquire((LONG64 volatile *)object, 0); \
4747
} while (0)
4848

4949
#define util_atomic_store_release(object, desired) \

0 commit comments

Comments
 (0)