View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Talk:Unsafe language

From LQWiki

Jump to: navigation, search

Some fact checks are perhaps needed here.

Under Linux (or any other UNIX) no process can handle memory directly. It might think it does because the OS does a good job of giving the process its own virtual memory space. It doesn't matter what language it was written in, if it steps outside the allocated memory there is a segfault and the process is killed.

There is shared memory, but that's a separate issue. Shared memory is a feature of POSIX and not really a language feature.

"Before a reliance on memory protection, security, and other issues, all programming languages were unsafe"

Not really. it wasn't the languages that were unsafe, but the compilers that insisted on absolute addressing.

C allows the programmer to access memory directly, or as directly as a computer with a VMMU can allow. AFAICS you can access memory juat as 'directly' in C as assembly. 'Directly' an unclear term here because anything running on a modern operating system sits on at least one virtual machine - the kernel.


Share

Personal tools