Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Daniel Dickman
> On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger wrote: > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: >> wc counts items in files. Finding the longest item indeed sounds >> like a task better suited to awk. Doesn’t gnu wc show that tabs have length 8 rather than length

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Joerg Sonnenberger
On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > wc counts items in files. Finding the longest item indeed sounds > like a task better suited to awk. Finding outliers, means and counting are all parts of the same basic class of operations. A good implementation of all of them requ

malloc: prep for immutable pages

2022-09-29 Thread Otto Moerbeek
Hi, Rearrange things so that we do not have to flip protection of r/o pages back and forth when swicthing from single-threaded to multi-threaded. Also saves work in many cases by not initing pools until they are used: the pool used for MAP_CONCEAL pages is not used by very many processes and if yo

tsc: AMD Family 17h, 19h: compute frequency from MSRs

2022-09-29 Thread Scott Cheloha
This patch computes the TSC frequency for AMD family 17h and 19h CPUs (Zen microarchitecture and up) from AMD-specific MSRs. Computing the TSC frequency is faster than calibrating with a separate timer and introduces no error. We already do this for Intel CPUs in tsc_freq_cpuid(). I got several

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Jonathan Gray
On Thu, Sep 29, 2022 at 08:57:04AM +, Job Snijders wrote: > Hi all, > > I often find myself piping data through ... | awk '{print length}' | ... > I figured there should be a more direct way that requires less typing. > Perhaps other developers have a similar itch? > > The FreeBSD, NetBSD, D

wc(1): add -L flag to write length of longest line

2022-09-29 Thread Job Snijders
Hi all, I often find myself piping data through ... | awk '{print length}' | ... I figured there should be a more direct way that requires less typing. Perhaps other developers have a similar itch? The FreeBSD, NetBSD, Dragonfly, and GNU variants of the wc(1) utility have a similar -L feature.