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

git version control git at videolan.org
Wed Aug 27 01:14:51 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Aug 26 20:14:54 2008 +0300| [be8ae0324243698ddfc098d481b2d3ab89f245c8] | committer: Christophe Mutricy 

Do not shrink allocated blocks.

Seems like it is too slow on Win32 (??). Hopefully fixes #1919.
(cherry picked from commit 8b71a21cbfb9ae45040dd56465ca409de68b4a3f)

Signed-off-by: Christophe Mutricy <xtophe at videolan.org>

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

 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