update malloc
							parent
							
								
									962109e855
								
							
						
					
					
						commit
						8581c11900
					
				|  | @ -108,20 +108,18 @@ pub fn malloc(n int) byteptr { | |||
| 	if n < 0 { | ||||
| 		panic('malloc(<0)') | ||||
| 	} | ||||
| 	/* | ||||
| 	$if debug { | ||||
| 	$if prealloc { | ||||
| 		res := g_m2_ptr | ||||
| 		g_m2_ptr += n | ||||
| 		nr_mallocs++ | ||||
| 		return res | ||||
| 	} $else { | ||||
| 		*/ | ||||
| 		ptr := C.malloc(n) | ||||
| 		if ptr == 0 { | ||||
| 			panic('malloc($n) failed') | ||||
| 		} | ||||
| 		return ptr | ||||
| 	//}
 | ||||
| 	} | ||||
| /* | ||||
| TODO | ||||
| #ifdef VPLAY | ||||
|  |  | |||
|  | @ -230,6 +230,9 @@ pub fn (v mut V) compile() { | |||
| 			cgen.genln('#define VDEBUG (1)') | ||||
| 		} | ||||
| 	} | ||||
| 	if v.pref.prealloc { | ||||
| 		cgen.genln('#define VPREALLOC (1)') | ||||
| 	} | ||||
| 	if v.os == .js { | ||||
| 		cgen.genln('#define _VJS (1) ') | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue