[Mesa-dev] [PATCH] mesa: Removed unnecessary check for NULL pointer when freeing memory block using _mesa_align_free.

2014-01-30 Thread Siavash Eliasi
Note that it is OK to pass NULL pointers to this function since this commit:

mesa: modified _mesa_align_free() to accept NULL pointer
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735
---
 src/mesa/main/bufferobj.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index cde6ac2..06928a0 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -562,8 +562,7 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, 
GLsizeiptrARB size,
 
(void) target;
 
-   if (bufObj-Data)
-  _mesa_align_free( bufObj-Data );
+   _mesa_align_free( bufObj-Data );
 
new_data = _mesa_align_malloc( size, ctx-Const.MinMapBufferAlignment );
if (new_data) {
-- 
1.8.5.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Removed unnecessary check for NULL pointer when freeing memory block using _mesa_align_free.

2014-01-30 Thread Marek Olšák
Reviewed-by: Marek Olšák marek.ol...@amd.com

Marek

On Thu, Jan 30, 2014 at 9:08 AM, Siavash Eliasi siavashser...@gmail.com wrote:
 Note that it is OK to pass NULL pointers to this function since this commit:

 mesa: modified _mesa_align_free() to accept NULL pointer
 http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735
 ---
  src/mesa/main/bufferobj.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

 diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
 index cde6ac2..06928a0 100644
 --- a/src/mesa/main/bufferobj.c
 +++ b/src/mesa/main/bufferobj.c
 @@ -562,8 +562,7 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, 
 GLsizeiptrARB size,

 (void) target;

 -   if (bufObj-Data)
 -  _mesa_align_free( bufObj-Data );
 +   _mesa_align_free( bufObj-Data );

 new_data = _mesa_align_malloc( size, ctx-Const.MinMapBufferAlignment );
 if (new_data) {
 --
 1.8.5.3

 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev