From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: Boundary calculation
Date: Tue, 17 Jul 2018 09:41:52 +0200 [thread overview]
Message-ID: <s5hfu0ijolb.wl-tiwai@suse.de> (raw)
In-Reply-To: <834aaf57-b1d0-1a00-48f8-796add3027e0@ladisch.de>
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
next prev parent reply other threads:[~2018-07-17 7:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 19:25 Boundary calculation Ricardo Biehl Pasquali
2018-07-17 6:43 ` Clemens Ladisch
2018-07-17 7:41 ` Takashi Iwai [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-07-17 13:13 Ricardo Biehl Pasquali
2018-07-17 15:33 ` Clemens Ladisch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hfu0ijolb.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox