next up previous contents index
Next: BASIC Model Up: Programming Interfaces Previous: Assembler Model

C Model

 

The C programming language has fairly standardized I/O libraries and storage management methods. Objects in main memory are categorized into three classes by the methods of storage allocation. Static objects are allocated at fixed addresses and always exist during the execution. Auto objects are allocated at stacks at the beginning of their scopes and destroyed at the end. Static and auto objects must have fixed sizes of their own. On the other hand, dynamic objects are allocated at the heap areas by the storage allocator routines: malloc() and free(). Allocation and destruction of dynamic objects must be explicitly controlled by the application. There are no other methods to access dynamic objects except pointers to them.

The standard I/O libraries provide the programmer with the methods of copying objects to and from file streams. However, pointers to objects in main memory become meaningless once they are copied to file streams. This restriction imposes different representations of linked objects in main memory and in files. Persistence of objects is not automatic in the C language.



Mori Tetsuya / t2y3141592@gmail.com