News for hackers. Stuff that matters.
Re:Writing C software without the standard library by std_throwaway on Tuesday November 29, 2016 @02:29AM (#13061472)
Unless you also need to free, it's pretty simple.
Re:Writing C software without the standard library by shultays on Tuesday November 29, 2016 @06:32AM (#13062385)
Also easy if your free/malloc is just a wrapper around munmap/mmap.
Re:Writing C software without the standard library by capnfantasic on Tuesday November 29, 2016 @03:06AM (#13061606)
Of course.

When I wrote that comment I asked myself should I have written "malloc" or "malloc/free" - surely one implies the other.

Re:Writing C software without the standard library by vidarh on Tuesday November 29, 2016 @12:13PM (#13064371)
For short-lived processes that do lots of allocations and where you can rely on the OS to release resources, just leaving out the deallocations is often faster.

Of course, you need to be careful as if you write code like that in a language without garbage collection, it's inherently not reuseable - retrofitting deallocation is often really painful because it gets easy to adopt patterns that make object ownership etc. unclear when you don't have to ensure it's easy to deallocate in the right order.

Re:Writing C software without the standard library by marcosdumay on Tuesday November 29, 2016 @08:28AM (#13062876)
Not surely. Many programs are written in a way that allocates all the needed heap space at startup, and just reuse it forever. And those are overrepresented on the minimal-system kinds of environment.
Re:Writing C software without the standard library by dom0 on Tuesday November 29, 2016 @04:29AM (#13061910)
Oh well, with 16 GB RAM even in laptops, who needs free anymore? Just restart the program. It's simpler anyway.
Re:Writing C software without the standard library by makapuf on Tuesday November 29, 2016 @04:39AM (#13061946)
ironic for a minimalist/anti bloat pamphlet to start with "with 16GB ..."