C Tutorial Dynamic Storage Allocation
The C Language
C History
BCPL
Euclid’s Algorithm in C
Euclid on the PDP-11
Pieces of C
C Types
Declarators
Struct bit-fields
Code generated by bit fields
C Unions
Layout of Records and Unions
C Storage Classes
malloc() and free()
Dynamic Storage Allocation

Simple Dynamic Storage Allocation
malloc() and free() variants
Fragmentation
Fragmentation and Handles
Automatic Garbage Collection
Arrays
Lazy Logical Operators
The Switch Statement
setjmp/longjmp: Sloppy exceptions
Nondeterminism in C

 

 

HOME
 


Rules:

Each allocated block contiguous (no holes) Blocks stay fixed once allocated

 

malloc() 

Find an area large enough for requested bloc

Mark memory as allocated

 

free() 

Mark the block as unallocated

 

  • Many, many other approaches. Other “fit”  algorithms Segregation of objects by size More clever data structures

 

Contact for more learning: webmaster@freehost7com