Re: Porting skalibs to GNU Hurd

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Thu, 17 Oct 2019 20:12:44 +0000

>A reasonable detection in configure stage is definitively to prefer.

Not necessarily. It would work, obviously, but would bloat the build.
Compile-time generated headers are kinda painful to manage, and I'd like
to keep their number in check. Also, using configure detection would
make nonposix.h depend on sysdeps.h, and that's a dependency I'd rather
avoid.


>If stack allocation is a must, maybe it can be evaluated whether
>alloca can be an alternative.

It cannot. alloca is not POSIX, not portable, and not safe.
And one of the main advantages of stack allocation is that it keeps the
code *simple*, compact, and easy to read, as opposed to having malloc()
calls everywhere; using alloca(), which is also a function call,
forfeits that advantage.

I'll do heap allocation where necessary and where I'm certain that
stralloc has already been pulled. For the other places, Hurd+skalibs
users
will simply have to avoid ricing their paths.

--
Laurent
Received on Thu Oct 17 2019 - 20:12:44 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC