rt0

Languages and libraries

c runtime

SHOW HN2015

rt0

Tiny C runtime Linux (rt0), HelloWorld 0.6k (i386), sbrk example added

github.com

#c runtime#linux#sbrk#newlib porting#i386

49points
10comments
#574of 2,565 in 2015
Top 23%of 2015 by points

How HN took it

QuietFewer than 5 comments about the project

0 positive, 0 neutral or asking, 0 mixed, 1 critical, out of 1 comments about the project.

Idea: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

Objections

  • sbrk is nearly deprecated; mmap or mprotect preferred by modern allocators

    From 2 comments
    • What is sbrk even used for anymore? Surely most heap allocators use mmap/mprotect directly these days. There's no downside. EDIT: Not trying to rain on anyone's parade, I think…
      duaneb on HN
    • sbrk competes with mmap, not mprotect. And yes, I would expect mmap to be used in most modern systems. OS X, for instance, just emulates sbrk with a large static buffer, and it…
      koenigdavidmj on HN
  • sbrk makes less sense with virtual memory

    From 1 comment
    • Yea, sbrk makes sense in a flat address space. I don't think it makes as much sense with virtual memory.
      duaneb on HN

Questions

  • What is sbrk used for anymore?

    From 1 comment
    • What is sbrk even used for anymore? Surely most heap allocators use mmap/mprotect directly these days. There's no downside. EDIT: Not trying to rain on anyone's parade, I think…
      duaneb on HN
  • How does virtual memory improve security?

    From 1 comment
    • Could you explain how virtual memory makes a process more secure? My intuition is that it would be another source of contention to manage (like CPU, RAM, IO, etc). Maybe you're…
      oso2k on HN

Alternatives named

  • mmap

    From 2 comments
    • What is sbrk even used for anymore? Surely most heap allocators use mmap/mprotect directly these days. There's no downside. EDIT: Not trying to rain on anyone's parade, I think…
      duaneb on HN
    • sbrk competes with mmap, not mprotect. And yes, I would expect mmap to be used in most modern systems. OS X, for instance, just emulates sbrk with a large static buffer, and it…
      koenigdavidmj on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/10375858)