zoukankan      html  css  js  c++  java
  • qf

    #pragma intrinsic (_InterlockedIncrement)
    #pragma intrinsic (_InterlockedDecrement)
    #pragma intrinsic (memcpy)

    The intrinsic pragma tells the compiler that a function has known behavior. The compiler may call the function and not replace the function call with inline instructions, if it will result in better performance. Link

    For Windows

    __declspec(align(8)) volatile long m_lRefCount;

    For Linux

    __attribute__((aligned(8))) volatile long m_lRefCount;

    This usage make the align for variable and require the value from variable, not from register.

    保证申请的代码是在这个类对象之后,+1相当于+sizeof(class),因为指针的+-是根据左操作数来决定的。

                    inline unsigned char *GetBuffer()
                    {
                      // the buffer follows immediately after this class
                      return (unsigned char *)(this + 1);
                    };

  • 相关阅读:
    BZOJ1513: [POI2006]Tet-Tetris 3D
    BZOJ3210: 花神的浇花集会
    BZOJ3207: 花神的嘲讽计划Ⅰ
    BZOJ3170: [Tjoi 2013]松鼠聚会
    BZOJ3747: [POI2015]Kinoman
    解题:POI 2008 Subdivision of Kingdom
    解题:JSOI 2007 重要的城市
    解题:USACO13NOV No Change
    解题:洛谷1120 小木棍
    解题:SCOI 2008 配对
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/3063275.html
Copyright © 2011-2022 走看看