[vlc-devel] commit: Do not shrink allocated blocks. ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Aug 26 19:13:23 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Aug 26 20:14:54 2008 +0300| [8b71a21cbfb9ae45040dd56465ca409de68b4a3f] | committer: Rémi Denis-Courmont 

Do not shrink allocated blocks.

Seems like it is too slow on Win32 (??). Hopefully fixes #1919.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b71a21cbfb9ae45040dd56465ca409de68b4a3f
---

 src/misc/block.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/misc/block.c b/src/misc/block.c
index a757e3c..d5ce01b 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -168,6 +168,10 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
         return p_rea;
     }
 
+#if 0
+    /* Shrinking the buffer seems to cause performance problems, on Windows,
+     * at least. Also with demand paging, oversizing buffers is not an issue,
+     * as long as we don't write to the extraneous allocated space. */
     /* We have a very large reserved footer now? Release some of it. */
     if ((p_sys->p_allocated_buffer + p_sys->i_allocated_buffer) -
         (p_block->p_buffer + p_block->i_buffer) > BLOCK_WASTE_SIZE)
@@ -185,7 +189,7 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
                 - ((uintptr_t)p_sys->p_allocated_buffer % BLOCK_ALIGN);
         }
     }
-
+#endif
     return p_block;
 }
 




More information about the vlc-devel mailing list