1. 3

  2. 1

    I was slightly repulsed when I saw a use of sbrk() but then the author provides redemption.

    With that said, NEVER use sbrk to allocate memory in real programs.

    One of the few times you might want to use sbrk() is if you’re writing code on a device that doesn’t have an operating system. Even then, you’re probably better off to tell the linker how much heap space you want and never change it.

    But then, in that case, you probably don’t need (or can’t even use) info proc mappings.