Skip to content

[FIX] Fix reference counting compilation on MSVC x86 - #916

Merged
tqchen merged 1 commit into
apache:mainfrom
miyanyan:fix-msvc-x86-refcount-upstream
Nov 4, 2026
Merged

tqchen merged 1 commit into
apache:mainfrom
miyanyan:fix-msvc-x86-refcount-upstream

Conversation

@miyanyan

@miyanyan miyanyan commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Another issue found in microsoft/vcpkg#54810

build error on 32bit:

D:\b\tvm-ffi\src\v0.1.15-e4904dcca0.clean\include\tvm/ffi/object.h(263): error C3861: '_InterlockedIncrement64': identifier not found
D:\b\tvm-ffi\src\v0.1.15-e4904dcca0.clean\include\tvm/ffi/object.h(320): error C3861: '_InterlockedDecrement64': identifier not found

Use the Windows SDK InterlockedIncrement64 and InterlockedDecrement64 wrappers, which support both 32-bit x86 and 64-bit x64 targets. On x86, they use a compare-exchange loop; on x64, they map directly to the corresponding intrinsics.

@tqchen
tqchen merged commit 4b3b01a into apache:main Nov 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants