Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_bits.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_bits.h	(revision 41070)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_bits.h	(revision 41071)
@@ -65,48 +65,4 @@
 }
 
-static INLINE int CHECKBIT( const unsigned int *b, const unsigned int bit )
-{
-    unsigned int node32 = bit >> 5;
-    unsigned int node = bit & 0x1f;
-
-    return !!(b[node32] & (1 < node));
-}
-
-static INLINE void CLEARBIT( unsigned int *b, const unsigned int bit )
-{
-    unsigned int node32 = bit >> 5;
-    unsigned int node = bit & 0x1f;
-
-    b[node32] &=  ~(1 << node);
-}
-
-static INLINE void SETBIT( unsigned int *b, const unsigned int bit )
-{
-    unsigned int node32 = bit >> 5;
-    unsigned int node = bit & 0x1f;
-
-    b[node32] |=  (1 << node);
-}
-
-static INLINE int HASBITS( const unsigned int *b )
-{
-    int j;
-
-    for (j=0;j<CR_MAX_BITARRAY;j++)
-        if (b[j])
-            return 1;
-
-    return 0;
-}
-
-static INLINE void CLEARBITS( unsigned int *b )
-{
-    int j;
-
-    for (j=0;j<CR_MAX_BITARRAY;j++)
-        b[j] = 0;
-}
-
-
 #ifdef __cplusplus
 }
Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h	(revision 41070)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h	(revision 41071)
@@ -54,4 +54,10 @@
 #ifndef IN_GUEST
 # include <VBox/vmm/ssm.h>
+# include <iprt/asm.h>
+
+# define CR_STATE_SHAREDOBJ_USAGE_INIT(_pObj) (crMemset((_pObj)->ctxUsage, 0, sizeof ((_pObj)->ctxUsage)))
+# define CR_STATE_SHAREDOBJ_USAGE_SET(_pObj, _pCtx) (ASMBitSet((_pObj)->ctxUsage, (_pCtx)->id))
+# define CR_STATE_SHAREDOBJ_USAGE_CLEAR(_pObj, _pCtx) (ASMBitClear((_pObj)->ctxUsage, (_pCtx)->id))
+# define CR_STATE_SHAREDOBJ_USAGE_IS_USED(_pObj) (ASMBitFirstSet((_pObj)->ctxUsage, sizeof ((_pObj)->ctxUsage)<<3) >= 0)
 #endif
 
@@ -115,9 +121,4 @@
     GLboolean   bFBOResyncNeeded;
 } CRSharedState;
-
-#define CR_STATE_SHAREDOBJ_USAGE_INIT(_pObj) (CLEARBITS((_pObj)->ctxUsage))
-#define CR_STATE_SHAREDOBJ_USAGE_SET(_pObj, _pCtx) (SETBIT((_pObj)->ctxUsage, (_pCtx)->id))
-#define CR_STATE_SHAREDOBJ_USAGE_CLEAR(_pObj, _pCtx) (CLEARBIT((_pObj)->ctxUsage, (_pCtx)->id))
-#define CR_STATE_SHAREDOBJ_USAGE_IS_USED(_pObj) (HASBITS((_pObj)->ctxUsage))
 
 /**
