Hacker News new | comments | ask | show | jobs | submit login

Its a nifty tool, but I can't help feeling a little disappointed that we're still having to deal directly with issues such as memory allocation in 2019.



Well 'we' deal with it so that you don't have to. What do you suggest? Somewhere memory needs to be allocated, this stuff isn't magic.


Somebody's got to deal with it so that you may have the luxury of not dealing with it.


How do you think we should be dealing with memory allocation instead?


    addr = getrandom(8);
    mem = mmap(addr, len, PROT_RWX, MAP_FIXED|MAP_ANON, -1, 0);


It's not realistic to use a per-allocation mapping like that in production - all your allocations will be scaled up to multiples of pages.


Whoosh!


> PROT_RWX

Hmm…


The X is for fleXibility.


How else will you put the self-modifying code there?


You don't necessarily.

Don't forget that theres memory managed languages that compile to c. They still use malloc under the hood.


Thats a good point.


Right? Just use JavaScript already! /s




Applications are open for YC Summer 2019

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

Search: