Re: PHP 4.0 Bug #5176 Updated: Memory leak? Type handling?

From: Date: Sat, 24 Jun 2000 07:59:45 +0000
Subject: Re: PHP 4.0 Bug #5176 Updated: Memory leak? Type handling?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22184@lists.php.net to get a copy of this message
P>> The bug is the fact that php allocated 4096 bytes per each array element P>> regardless of the fact that each element was only 8 bytes long in actually. P>> As I understand PHP's type handling should have realloced the array P>> element's size to somewhere around 8 bytes, definitely not 4096 bytes. That's because fgets allocates 4096 buffer, as you said it. There's no good way to resize it, since fgets does not return how much bytes did it read. Maybe it could be fixed trimming it to strlen of buffer, I am not sure on this yet... -- Stanislav Malyshev stas@zend.com +972-3-6139665

« previous php.dev (#22184) next »