Skip to content

Reference counts use different types on different compilers #141

Description

@AlpyneDreams

IResource and RefCountPtr and RefCounter<T> use unsigned long which does not have a consistent size on different x64 compilers. With MSVC it is 32 bits, with GCC and Clang it is 64 bits.

This makes it difficult to write portable code if you interact with NVRHI refcounts at all, which is often necessary e.g. to implement interfaces like ICommandListLifetimeTracker.

I think the best fix would be to use uint32_t to make it consistent with Microsoft's IUnknown which always uses a 32-bit refcount (e.g. in Wine, ULONG is always 32-bits).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions