On Oct 30, 2012, at 3:05 PM, 幰彰王 wrote:

> Hi all,
> I think the statement "Buffer = NULL;" is redundant or we might modify the 
> function as below:
> 
> STATIC
> VOID
> EFIAPI
> SafeFreePool (
>   IN VOID   **Buffer
>   )
> {
>   if (*Buffer != NULL) {
>     gBS->FreePool (*Buffer);
>     *Buffer = NULL;
>   }
> }
> 
> How do you think about this?
> 

I think changing the library API by adding an extra * to buffer would break all 
the calling code. 

I agree that setting the pointer, that is just in a register, to NULL does 
nothing. We should probably just remove the `Buffer = NULL` from the library 
function. 

> Regards,
> -Hsien
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to