Skip to content

Commit

Permalink
Merge pull request #1084 from igchor/fix_windows_critnib
Browse files Browse the repository at this point in the history
[UR] Fix critnib on windows
  • Loading branch information
omarahmed1111 authored Nov 29, 2023
2 parents 54aff86 + ef109b2 commit 26e98b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/common/unified_malloc_framework/src/critnib/critnib.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
#define DELETED_LIFE 16

#define SLICE 4
#define NIB ((1UL << SLICE) - 1)
#define NIB ((1ULL << SLICE) - 1)
#define SLNODES (1 << SLICE)

typedef uintptr_t word;
Expand Down Expand Up @@ -156,7 +156,7 @@ static inline bool is_leaf(struct critnib_node *n) { return (word)n & 1; }
* internal: to_leaf -- untag a leaf pointer
*/
static inline struct critnib_leaf *to_leaf(struct critnib_node *n) {
return (void *)((word)n & ~1UL);
return (void *)((word)n & ~1ULL);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion source/common/unified_malloc_framework/src/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static __inline unsigned char util_mssb_index(long long value) {
// There is no good way to do atomic_load on windows...
#define util_atomic_load_acquire(object, dest) \
do { \
*dest = InterlockedOr64Acquire((LONG64 volatile *)dest, 0); \
*dest = InterlockedOr64Acquire((LONG64 volatile *)object, 0); \
} while (0)

#define util_atomic_store_release(object, desired) \
Expand Down

0 comments on commit 26e98b5

Please sign in to comment.