Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funny you mention "black box automated process" because, what do you think malloc is?

There are two ways of allocating memory directly from the kernel (IIRC), brk and mmap.

There's some management malloc does, and if it's good or not depends on you application.

For example, size, number and behaviour of your allocations. Depending on your situation you may want to do your own memory management.



When I worked on embedded systems, we didn't use malloc() at all, just some heap functions. Even after that, there have been times where I worked on projects where there was a single malloc() and that was turned into a memory heap.

However, a call to malloc() is pretty straightforward, you expect it to return a pointer to the allotted memory, or not. Using a GC or the boots libraries is not quite as straightforward, and the black box is a lot bigger.


You're kind of reinforcing the OP's point though. C does lack easy memory management, unless you're ready to rely on external GC libraries.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: