diff --git a/Writerside/topics/Computer-Architecture.md b/Writerside/topics/Computer-Architecture.md index 6934f77..886f3df 100644 --- a/Writerside/topics/Computer-Architecture.md +++ b/Writerside/topics/Computer-Architecture.md @@ -806,7 +806,7 @@ struct hello {

sizeof(hello) = 16

-

Imporvement:

+

Improvement:

struct hello { @@ -822,27 +822,27 @@ struct hello {

sizeof(hello) = 12

-### 4 C Memory Layout +### 3 C Memory Layout

Program's address space contains 4 regions:

  • -

    Stack: local variables, -grow downwards.

    +

    Stack: local variables, + grow downwards.

  • -

    Heap: space requested via -malloc() and used with pointers; resizes dynamically, -grow upward.

    +

    Heap: space requested via + malloc() and used with pointers; resizes dynamically, + grow upward.

  • -

    Static Data: global or -static variables, does not grow or shrink.

    +

    Static Data: global or static + variables, does not grow or shrink.

  • -

    Code: loaded when program -starts, does not change.

    +

    Code: loaded when program + starts, does not change.

  • @@ -852,25 +852,25 @@ starts, does not change.

  • -

    Declared outside a function: - Static Data

    +

    Declared outside a function: + Static Data

  • -

    Declared inside a function: - Stack

    +

    Declared inside a function: + Stack

  • -

    main() is a function.

    +

    main() is a function.

  • -

    freed when function returns.

    +

    freed when function returns.

  • -

    Dynamically allocated (i.e., -malloc, calloc & realloc): - Heap.

    +

    Dynamically allocated (i.e., + malloc, calloc & realloc): + Heap.