Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UR] Fix critnib on windows #1084

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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