Commit 3de41162 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Save one pointer and dereference in the block core

parent 7d5a2026
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
/* private */ /* private */
struct block_sys_t struct block_sys_t
{ {
uint8_t *p_allocated_buffer;
size_t i_allocated_buffer; size_t i_allocated_buffer;
uint8_t p_allocated_buffer[0];
}; };
#define BLOCK_PADDING_SIZE 32 #define BLOCK_PADDING_SIZE 32
...@@ -58,8 +58,6 @@ block_t *__block_New( vlc_object_t *p_obj, size_t i_size ) ...@@ -58,8 +58,6 @@ block_t *__block_New( vlc_object_t *p_obj, size_t i_size )
/* Fill opaque data */ /* Fill opaque data */
p_sys = (block_sys_t*)( (uint8_t*)p_block + sizeof( block_t ) ); p_sys = (block_sys_t*)( (uint8_t*)p_block + sizeof( block_t ) );
p_sys->i_allocated_buffer = i_alloc; 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 */ /* Fill all fields */
p_block->p_next = NULL; p_block->p_next = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment