Re: [PHP4BETA] (Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h
| From: | Sascha Schumann | Date: | Fri, 08 Oct 1999 15:14:53 +0000 |
| Subject: | Re: [PHP4BETA] (Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-5399@lists.php.net to get a copy of this message | ||
On Fri, Oct 08, 1999 at 11:02:23AM -0400, Rasmus Lerdorf wrote:
> On Fri, 8 Oct 1999, Andrei Zmievski wrote:
>
> > Sascha Schumann wrote:
> > > Nope. As I stated earlier, qsort isn't broken (even not on
> > > Solaris), so there is no reason to replace it.
> >
> > Ok, then it doesn't make sense to introduce merge_sort since we can just copy
> > zend_hash_sort() and swap the entries around manually. I just didn't want to
> > do that because zend_hash_sort() uses a lot of internal structures like
> > Bucket* and calls like HANDLE_INTERRUPTIONS().
>
> qsort() on Solaris seems pretty broken to me. When you feed it a
> non-causal comparison function, it sometimes screws up.
The compare function passed to qsort must be deterministic.
> static int cmp(const void *a, const void *b) {
> return( (rand()%2) ? -1 : 1 );
> }
rand() isn't deterministic. That's the problem here.
--
Regards,
Sascha Schumann
Consultant