Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2006 11:25:13 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 104028 for review
Message-ID:  <200608151125.14251.jhb@freebsd.org>
In-Reply-To: <200608151359.k7FDxAZU093877@repoman.freebsd.org>
References:  <200608151359.k7FDxAZU093877@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 15 August 2006 09:59, Roman Divacky wrote:
> http://perforce.freebsd.org/chv.cgi?CH=104028
> 
> Change 104028 by rdivacky@rdivacky_witten on 2006/08/15 13:58:45
> 
> 	MALLOC -> malloc and FREE -> free
> 	
> 	Pointed out by: jhb
> 
> Affected files ...
> 
> .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_emul.c#9 
edit
> 
> Differences ...
> 
> 
==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_emul.c#9 
(text+ko) ====
> 
> @@ -82,14 +82,14 @@
>  
>  	if (child != 0) {
>  	   	/* non-exec call */
> -   		MALLOC(em, struct linux_emuldata *, sizeof *em, M_LINUX, M_WAITOK | 
M_ZERO);
> +   		em = (struct linux_emuldata *) malloc(sizeof *em, M_LINUX, M_WAITOK |

Note that in C you can drop the cast as C allows for void * objects to 
silently become a different pointer specifically so you don't have to use 
casts with malloc(). :)

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608151125.14251.jhb>