[vlc-commits] block: remove block shrinking
Rémi Denis-Courmont
git at videolan.org
Tue Sep 1 20:35:34 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Sep 1 21:08:43 2015 +0300| [ba7f5acd1517d7da4b3e285449e1ff80966d18f3] | committer: Rémi Denis-Courmont
block: remove block shrinking
This was a failed attempt to work-around performance problems with UDP
reception.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ba7f5acd1517d7da4b3e285449e1ff80966d18f3
---
src/misc/block.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/src/misc/block.c b/src/misc/block.c
index c5d9f62..ef1d557 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -123,9 +123,6 @@ static void BlockMetaCopy( block_t *restrict out, const block_t *in )
/** Initial reserved header and footer size. */
#define BLOCK_PADDING 32
-/* Maximum size of reserved footer before shrinking with realloc(). */
-#define BLOCK_WASTE_SIZE 2048
-
block_t *block_Alloc (size_t size)
{
/* 2 * BLOCK_PADDING: pre + post padding */
@@ -224,22 +221,6 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
return NULL;
p_block = p_rea;
}
- else
- /* We have a very large reserved footer now? Release some of it.
- * XXX it might not preserve the alignment of p_buffer */
- if( p_end - (p_block->p_buffer + i_body) > BLOCK_WASTE_SIZE )
- {
- block_t *p_rea = block_Alloc( requested );
- if( p_rea )
- {
- BlockMetaCopy( p_rea, p_block );
- p_rea->p_buffer += i_prebody;
- p_rea->i_buffer -= i_prebody;
- memcpy( p_rea->p_buffer, p_block->p_buffer, p_block->i_buffer );
- block_Release( p_block );
- p_block = p_rea;
- }
- }
/* NOTE: p_start and p_end are corrupted from this point */
More information about the vlc-commits
mailing list