Re: Boundary calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 Jul 2018 08:43:27 +0200,
Clemens Ladisch wrote:
> 
> Ricardo Biehl Pasquali wrote:
> > The current calculation for boundary is:
> >
> > 	boundary = buffer_size;
> > 	while (boundary * 2 <= LONG_MAX - buffer_size)
> > 		boundary *= 2;
> >
> > Why isn't a simpler calculation used instead? e.g.:
> >
> > 	/* closest multiple of buffer size less or equal LONG_MAX */
> > 	boundary = LONG_MAX - LONG_MAX % buffer_size;
> 
> To ensure that the factor is a power of two.
> 
> Originally, that was not really necessary, but the algorithm is
> now part of the kernel/userspace interface.

Right.

I don't think we have strictly ABI issue even if relaxing this, but I
also don't think it would give so much benefit, either.


thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux