Explorar o código

minor gc optimization: no need to set bmp bits to 0, only check in GC_DEBUG that they are

ncannasse %!s(int64=6) %!d(string=hai) anos
pai
achega
2ff51637da
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      src/alloc.c

+ 2 - 3
src/alloc.c

@@ -622,14 +622,13 @@ alloc_var:
 	if( p->bmp ) {
 		int i;
 		int bid = p->next_block;
+#		ifdef GC_DEBUG
 		for(i=0;i<nblocks;i++) {
-#			ifdef GC_DEBUG
 			if( (p->bmp[bid>>3]&(1<<(bid&7))) != 0 ) hl_fatal("Alloc on marked block");
-#			endif
-			p->bmp[bid>>3] &= ~(1<<(bid&7));
 			bid++;
 		}
 		bid = p->next_block;
+#		endif
 		p->bmp[bid>>3] |= 1<<(bid&7);
 	} else {
 		p->free_blocks = p->max_blocks - (p->next_block + nblocks);