U0 QSortI64(I64 *base,I64 num, I64 (*fp_compare)(I64 e1,I64 e2)) {/*Quick Sort for width==8. fp_compare() passes by value instead of ref. For ascending strings: return StrCmp(e1,e2); For ascending ints : return e1-e2; Maybe, look at $LK,"::/Demo/MultiCore/MPRadix.HC"$. */ I64 i,*left,*right,pivot; if (num>1) { left =base; right=base+num-1; pivot=base[num/2]; do { while ((*fp_compare)(*left,pivot)<0) left++; while ((*fp_compare)(*right,pivot)>0) right--; if (left<=right) SwapI64(left++,right--); } while (left<=right); i=right+1-base; if (10) right--; if (left<=right) SwapI64(left++,right--); } while (left<=right); i=right+1-base; if (10) right-=width; if (left<=right) { if (left!=right) { MemCpy(tmp,right,width); MemCpy(right,left,width); MemCpy(left,tmp,width); } left+=width; right-=width; } } while (left<=right); i=1+(right-base)/width; if (11) { if (width==sizeof(U8 *)) //assign instead of MemCpy for width 8 QSort2a(base,num,fp_compare); else { tmp=MAlloc(width*2); QSort2b(base,num,width,fp_compare,tmp); Free(tmp); } } }