[CS 61] Data Representation

Kieun Kim·2021년 8월 11일
0

CS 61 SPMO 2020

목록 보기
2/3

Overview

  1. Bytes of memory
  2. Objects
  3. Segments
  4. Abstract machine and hardware
  5. Unsigned integer representation
  6. Signed integer representation
  7. Pointer representation
  8. Array access performance
  9. Array representation
  10. Compiler layout
  11. Alignment
  12. Collection representation
  13. Consequences of the size and alignment rules
  14. unintialized objects
  15. Compiler hijinks
  16. Pointer arithmetic
  17. Undefined behavior
  18. Undefined behavior and optimization
  19. Integer undefiend behavior
  20. Sanitizers
  21. Signed integer undefined behavior
  22. Computer arithmetic and bitwise operations
  23. Arena allocation

Bytes of memory

  • Bit
    • The smallest unit of storage
    • A base-two digit : 0 or 1
  • Physical address
    • The lowest-level kind of address
    • It really does take on values between 0 and M-1
      ( M bytes of memory , 16 gigabutes of memory => M = 16 * 2^30 = 2^34 )
  • Virtual address
    • The addresses used in programs
    • It is incredibly useful for protection

Objects

  • Object : a region of data storage that contains a value
  • The compiler, hardware, and standard together define how objects of different types map to bytes
  • sizeof : returns the size of object x
    • size_t : a value of result for 'sizeof', unsigned integer type
    • On 64-bit architectures, size_t can hold numbers between 0 and 2^64-1
  • aliases : The different names of an object
profile
Connecting dots

0개의 댓글