Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C

Name: Anonymous 2011-12-20 17:18

Name: Anonymous 2011-12-20 23:04

C is designed to be portable. Portable doesn't mean "runs on Windows and Linux" or "runs on 32-bit and 64-bit versions of the same architecture." It means it can run on everything: nearly any conceivable binary CPU past, present, and future. If the machine uses 609-bit tagged pointers and 21-bit bytes, Standard C programs would still work. If integers are mixed-endian sign-magnitude with padding bits and floats are not IEEE (or IEEE decimal), Standard C programs would still work. If it's a stack machine (e.g. the JVM, Forth or Lisp Machines), Standard C programs would still work. If it's a 12-bit Harvard architecture or a 36-bit PDP-10, Standard C programs would still work. This is the main reason why C has so much undefined behavior and a minimal standard library.

In Unix, memory allocated in a C program is released when the process terminates, but in some single-tasking embedded OSes or OSes with a single address space for all threads, dynamic memory must be freed manually or it will not be reclaimed until a reboot, and in a Lisp Machine or JVM implementation, the memory may be automatically garbage-collected and free() might just give a hint to the garbage collector.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List