3 ms·
What modern OS doesn't have the equivalent of mmap? Just som #ifdefs. I didn't know I'd ever hear "use malloc, because it's portable". sylware is pretty much r
by the-smug-c-one 2y ago
What modern OS doesn't have the equivalent of mmap? Just som #ifdefs. I didn't know I'd ever hear "use malloc, because it's portable".
sylware is pretty much right anyway. Try to avoid malloc, or write smaller allocators on top of malloc.
- pjmlp 2y agoWhy bother with some #ifdefs when the ISO C standard library already does the job?
- the-smug-c-one 2y agoBecause you're probably writing a much larger program so some ifdefs aren't a big deal :-).
- keyle 2y agoThis is a silly argument because at the end of the day, once you make your code portable, you've now duplicated 99% of malloc and free, and you've left a mess for the team or next guy to maintain on top of everything else. You've successfully lowered the abstraction floor which is already pretty low in C.
- sylware 2y agowhat?? The whole point is to create independence, then create "real-life" alternatives. I don't understand your point.