git.videolan.org
/
vlc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7d5a202
)
Save one pointer and dereference in the block core
author
Rémi Denis-Courmont
<rem@videolan.org>
Mon, 26 Nov 2007 18:40:44 +0000
(18:40 +0000)
committer
Rémi Denis-Courmont
<rem@videolan.org>
Mon, 26 Nov 2007 18:40:44 +0000
(18:40 +0000)
src/misc/block.c
patch
|
blob
|
history
diff --git
a/src/misc/block.c
b/src/misc/block.c
index
c854ec1
..
e41cd7b
100644
(file)
--- a/
src/misc/block.c
+++ b/
src/misc/block.c
@@
-33,8
+33,8
@@
/* private */
struct block_sys_t
{
- uint8_t *p_allocated_buffer;
size_t i_allocated_buffer;
+ uint8_t p_allocated_buffer[0];
};
#define BLOCK_PADDING_SIZE 32
@@
-58,8
+58,6
@@
block_t *__block_New( vlc_object_t *p_obj, size_t i_size )
/* Fill opaque data */
p_sys = (block_sys_t*)( (uint8_t*)p_block + sizeof( block_t ) );
p_sys->i_allocated_buffer = i_alloc;
- p_sys->p_allocated_buffer = (uint8_t*)p_block + sizeof( block_t ) +
- sizeof( block_sys_t );
/* Fill all fields */
p_block->p_next = NULL;