News for hackers. Stuff that matters.
Re:What causes Ruby memory bloat? by CBLT on Thursday March 14, 2019 @10:56PM (#19396041)
>it's not accurate to call `malloc()` and family in glibc the "operating system's memory allocator."

I watched an interview with Bryan Cantrill some time ago and one of the things he mentioned is that libc is considered part of the operating system for other unixes, and Linux is the only one that decided to redefine operating system to exclude libc.

Re:What causes Ruby memory bloat? by pjmlp on Friday March 15, 2019 @02:39AM (#19397129)
As per ISO C, libc is part of the compiler.

Whatever else ends up there, like POSIX support, is implementation specific.

Re:What causes Ruby memory bloat? by jchw on Friday March 15, 2019 @11:20AM (#19400469)
I wonder why the ISO C standard is specifying who is responsible for implementing libc. That seems screwy at best.

Regardless, afaik OpenBSD and FreeBSD both ship libc as part of the operating system. It makes a lot of sense, really, because libc is bound to need to make syscalls, which differ strongly depending on the kernel, whereas the user interface of libc is pretty much the same across any operating system.

Re:What causes Ruby memory bloat? by hangonhn on Friday March 15, 2019 @11:33AM (#19400600)
Would memory allocation also be hardware dependent and thus vary as well depending on what hardware the OS decides to support?
Re:What causes Ruby memory bloat? by jchw on Friday March 15, 2019 @12:05PM (#19400917)
You mean like devices without MMUs? I think that might be the case but I'm not sure. Under Linux you need a special kernel and libc to handle such devices IIRC.
Re:What causes Ruby memory bloat? by pjmlp on Friday March 15, 2019 @01:29PM (#19402006)
Because not every OS is an UNIX clone and C also targets bare metal.
Re:What causes Ruby memory bloat? by jchw on Friday March 15, 2019 @01:57PM (#19402346)
- afaik freestanding C specifies no standard library at all (except pure headers,) so bare metal targets providing libc are going beyond the standard.

- I'm just saying it doesn't need to specify who implements the standard library. I've read the standard before and I don't really recall this coming up, I'm just assuming this assertion is accurate.

(And of course, the overwhelming reality is that libc is provided by none of the compilers except Microsoft C, since Clang and GCC tend to be used with glibc.)

Re:What causes Ruby memory bloat? by pjmlp on Friday March 15, 2019 @03:26PM (#19403280)
There is a world beyond gcc, clang and MSVC.

Just out of my head, MikroElektronika, TI, Green Hills, Embarcadero, IBM, HP, Unisys, Intel, PGI.

Re:What causes Ruby memory bloat? by jchw on Friday March 15, 2019 @04:29PM (#19403986)
Even then, the comments regarding "freestanding" C runtimes are the same. Targeting bare metal puts the standard library squarely out of scope of the standard.