Changeset 310 for trunk/thune/make.c
- Timestamp:
- 11/20/06 03:13:29 (2 years ago)
- Files:
-
- 1 modified
-
trunk/thune/make.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/make.c
r301 r310 213 213 If retp is non-zero it will be set to the new buffer. 214 214 */ 215 UIndex ur_make Buffer( int dataType, int size, UBuffer** retp )216 { 217 U Buffer* buf;218 UGCArray* gc = &ur_env-> buffers;215 UIndex ur_makeResource( int dataType, int size, UResource** retp ) 216 { 217 UResource* buf; 218 UGCArray* gc = &ur_env->resources; 219 219 UArray* ca = &gc->arr; 220 220 … … 224 224 #endif 225 225 226 if( ur_env-> buffers.freeCount )226 if( ur_env->resources.freeCount ) 227 227 { 228 228 #ifndef GC_STRESS_TEST 229 229 getFree: 230 230 #endif 231 buf = ((U Buffer*) ca->ptr.v) + gc->freeList;231 buf = ((UResource*) ca->ptr.v) + gc->freeList; 232 232 233 233 assert( gc->freeList > -1 ); … … 244 244 { 245 245 ur_recycle( ur_env ); 246 if( ur_env-> buffers.freeCount )246 if( ur_env->resources.freeCount ) 247 247 goto getFree; 248 248 } 249 249 #endif 250 250 251 UR_EXPAND_1( U Buffer, ca, buf );251 UR_EXPAND_1( UResource, ca, buf ); 252 252 253 253 init: … … 259 259 *retp = buf; 260 260 261 return buf - ((U Buffer*) ca->ptr.v);261 return buf - ((UResource*) ca->ptr.v); 262 262 } 263 263 … … 374 374 blk->ptr.cells + blk->used, 375 375 rblk->ptr.cells ); 376 #if 0 377 // Deep copy 378 it = rblk->ptr.cells; 379 rend = rblk->ptr.cells + size; 380 while( it != rend ) 381 { 382 ur_clone( it, UR_COPY_ALL, 2 ); 383 ++it; 384 } 385 #endif 376 386 377 387 // Init new words to none. … … 888 898 889 899 890 void ur_makeCoordBlk(UCell* res, UCell* blkCell )900 static void ur_makeCoordBlk( UThread* ur_thread, UCell* res, UCell* blkCell ) 891 901 { 892 902 int len; … … 905 915 if( len == UR_COORD_MAX ) 906 916 break; 917 } 918 else if( ur_isAWord(it) ) 919 { 920 UCell* val = ur_wordCell( ur_thread, it ); 921 if( ! val ) 922 return; 923 if( ur_is(val, UT_INT) || ur_is(val, UT_CHAR) ) 924 { 925 res->coord.elem[ len++ ] = ur_int(val); 926 if( len == UR_COORD_MAX ) 927 break; 928 } 907 929 } 908 930 ++it; … … 1254 1276 else if( ur_is(tos, UT_BLOCK) ) 1255 1277 { 1256 ur_makeCoordBlk( res, tos );1278 ur_makeCoordBlk( ur_thread, res, tos ); 1257 1279 } 1258 1280 else
