News for hackers. Stuff that matters.
Re:On programming without malloc by munificent on Wednesday December 04, 2013 @02:34PM (#6849494)
You jest, but you'd actually get surprisingly far just doing:

    void* malloc(size_t size) {
      static void* everything = 0;
      void* result = everything;
      everything += size;
      return result;
    }
When people are hacking together VMs for garbage collected languages, the first allocator often looks like this until they get around to actually collecting the garbage.
Re:On programming without malloc by apgwoz on Wednesday December 04, 2013 @02:37PM (#6849511)
You can get `free` pretty simply too: https://news.ycombinator.com/item?id=6849471
Re:On programming without malloc by stephen_g on Thursday December 05, 2013 @07:41AM (#6854103)
Depending on how your memory is mapped, everything should probably be an address higher than the kernel (you can get your linker script to generate the right address). Sometimes the kernel is at the top of the address space though so you could start your heap at the bottom.