Browse Source

Fixes for non-GC ptr types.

Mark Sibly 9 years ago
parent
commit
3761ac24b1
2 changed files with 10 additions and 23 deletions
  1. 2 23
      modules/monkey/native/bbgc.h
  2. 8 0
      modules/monkey/native/bbobject.h

+ 2 - 23
modules/monkey/native/bbgc.h

@@ -259,35 +259,14 @@ template<class T> struct bbGCRootVar : public bbGCVar<T>,public bbGCRoot{
 	}
 };
 
-inline void bbGCMark( bbBool ){}
-inline void bbGCMark( bbByte ){}
-inline void bbGCMark( bbUByte ){}
-inline void bbGCMark( bbShort ){}
-inline void bbGCMark( bbUShort ){}
-inline void bbGCMark( bbInt ){}
-inline void bbGCMark( bbUInt ){}
-inline void bbGCMark( bbLong ){}
-inline void bbGCMark( bbULong ){}
-inline void bbGCMark( bbFloat ){}
-inline void bbGCMark( bbDouble ){}
-
-template<class T> void bbGCMark( const T &t ){
-}
+template<class T> void bbGCMark( const T &t  ){}
 
 template<class T> void bbGCMark( const bbGCVar<T> &v ){
 	bbGC::enqueue( dynamic_cast<bbGCNode*>( v._ptr ) );
 }
 
-template<class T> void bbGCMark( T *p ){
+template<class T> void bbGCMarkPtr( T *p ){
 	bbGC::enqueue( dynamic_cast<bbGCNode*>( p ) );
 }
 
-template<class T,class C> T bb_object_cast( const bbGCVar<C> &p ){
-	return dynamic_cast<T>( p._ptr );
-}
-
-template<class T,class C> T bb_object_cast( C *p ){
-	return dynamic_cast<T>( p );
-}
-
 #endif

+ 8 - 0
modules/monkey/native/bbobject.h

@@ -50,6 +50,14 @@ template<class T,class...A> T *bbGCNew( A...a ){
 	return p;
 }
 
+template<class T,class C> T bb_object_cast( const bbGCVar<C> &p ){
+	return dynamic_cast<T>( p._ptr );
+}
+
+template<class T,class C> T bb_object_cast( C *p ){
+	return dynamic_cast<T>( p );
+}
+
 inline void bbDBAssertSelf( void *p ){
 	bbDebugAssert( p,"'Self' is null" );
 }