Răsfoiți Sursa

Allow for larger array memory allocation.

Brucey 4 ani în urmă
părinte
comite
5fbfed78f3
3 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 1 1
      blitz.mod/blitz_array.c
  2. 2 2
      blitz.mod/blitz_gc.c
  3. 1 1
      blitz.mod/blitz_gc.h

+ 1 - 1
blitz.mod/blitz_array.c

@@ -84,7 +84,7 @@ static int arrayCellSize(const char * type, unsigned short data_size, int * flag
 
 static BBArray *allocateArray( const char *type,int dims,int *lens, unsigned short data_size ){
 	int k,*len;
-	int size=4;
+	unsigned int size=4;
 	int length=1;
 	int flags=BBGC_ATOMIC;
 	BBArray *arr;

+ 2 - 2
blitz.mod/blitz_gc.c

@@ -83,7 +83,7 @@ void bbGCStartup( void *spTop ){
 	bbReleaseRetainGuard = bb_create_mutex();
 }
 
-BBGCMem *bbGCAlloc( int sz,BBGCPool *pool ){
+BBGCMem *bbGCAlloc( unsigned int sz,BBGCPool *pool ){
 	GC_finalization_proc ofn;
 	void *ocd;
 	BBGCMem *q=(BBGCMem*) GC_MALLOC( sz );
@@ -96,7 +96,7 @@ BBGCMem *bbGCAlloc( int sz,BBGCPool *pool ){
 	return q;
 }
 
-BBObject * bbGCAllocObject( int sz,BBClass *clas,int flags ){
+BBObject * bbGCAllocObject( unsigned int sz,BBClass *clas,int flags ){
 	BBObject *q;
 	if( flags & BBGC_ATOMIC ){
 		q=(BBObject*)GC_MALLOC_ATOMIC( sz );

+ 1 - 1
blitz.mod/blitz_gc.h

@@ -56,7 +56,7 @@ void		bbGCStartup();
 void		bbGCSetMode( int mode );
 void		bbGCSetDebug( int debug );
 void*	bbGCMalloc( int size,int flags );
-BBObject*	bbGCAllocObject( int size,BBClass *clas,int flags );
+BBObject*	bbGCAllocObject( unsigned int size,BBClass *clas,int flags );
 int 		bbGCValidate( void *p );
 size_t		bbGCMemAlloced();
 size_t		bbGCCollect();