]> git.sesse.net Git - vlc/commitdiff
Do not shrink allocated blocks.
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 26 Aug 2008 17:14:54 +0000 (20:14 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 26 Aug 2008 17:15:18 +0000 (20:15 +0300)
Seems like it is too slow on Win32 (??). Hopefully fixes #1919.

src/misc/block.c

index a757e3cf2d487753602ca57282b3e905d2940095..d5ce01b05bc1bf5a4d26ec966a89bd94f42fba76 100644 (file)
@@ -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;
 }