VirtualBox

Changeset 37209 in vbox for trunk/include


Ignore:
Timestamp:
May 25, 2011 9:33:12 AM (14 years ago)
Author:
vboxsync
Message:

circbuf: Use ASMAtomic*Z instead of ASMAtomic*Size because the latter is causing trouble on recent microsoft compilers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r36595 r37209  
    17541754
    17551755/**
     1756 * Atomically reads a size_t value, ordered.
     1757 *
     1758 * @returns Current *pcb value
     1759 * @param   pcb     Pointer to the size_t variable to read.
     1760 */
     1761DECLINLINE(size_t) ASMAtomicReadZ(size_t volatile *pcb)
     1762{
     1763#if ARCH_BITS == 64
     1764    return ASMAtomicReadU64((uint64_t volatile *)pcb);
     1765#elif ARCH_BITS == 32
     1766    return ASMAtomicReadU32((uint32_t volatile *)pcb);
     1767#else
     1768# error "Unsupported ARCH_BITS value"
     1769#endif
     1770}
     1771
     1772
     1773/**
     1774 * Atomically reads a size_t value, unordered.
     1775 *
     1776 * @returns Current *pcb value
     1777 * @param   pcb     Pointer to the size_t variable to read.
     1778 */
     1779DECLINLINE(size_t) ASMAtomicUoReadZ(size_t volatile *pcb)
     1780{
     1781#if ARCH_BITS == 64
     1782    return ASMAtomicUoReadU64((uint64_t volatile *)pcb);
     1783#elif ARCH_BITS == 32
     1784    return ASMAtomicUoReadU32((uint32_t volatile *)pcb);
     1785#else
     1786# error "Unsupported ARCH_BITS value"
     1787#endif
     1788}
     1789
     1790
     1791/**
    17561792 * Atomically reads a pointer value, ordered.
    17571793 *
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette