projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
689b20c
)
mesa: Use _mesa_align_malloc in _mesa_buffer_data
author
Siavash Eliasi
<siavashserver@gmail.com>
Thu, 28 Nov 2013 08:56:37 +0000
(12:26 +0330)
committer
Ian Romanick
<ian.d.romanick@intel.com>
Wed, 29 Jan 2014 16:11:39 +0000
(09:11 -0700)
v2: Fixed memory leak.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/bufferobj.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/bufferobj.c
b/src/mesa/main/bufferobj.c
index e305038bdbe6b2227580af7c0b113fc880943f9a..cde6ac2acafaf36cc67715f757ed5582ba8a927e 100644
(file)
--- a/
src/mesa/main/bufferobj.c
+++ b/
src/mesa/main/bufferobj.c
@@
-560,9
+560,12
@@
_mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
{
void * new_data;
- (void) ctx; (void) target;
+ (void) target;
+
+ if (bufObj->Data)
+ _mesa_align_free( bufObj->Data );
- new_data = _mesa_
realloc( bufObj->Data, bufObj->Size, size
);
+ new_data = _mesa_
align_malloc( size, ctx->Const.MinMapBufferAlignment
);
if (new_data) {
bufObj->Data = (GLubyte *) new_data;
bufObj->Size = size;