Skip to content

Commit

Permalink
updating memory layout diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
yqh committed Oct 4, 2019
1 parent 29f53ce commit 3acb111
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 8 additions & 4 deletions lab3/starter/cURL_IPC/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,26 @@
Here is the memory layout.
Note that the memory is a chunk of continuous bytes.
On a 64-bit machine, the memory layout is as follows:
+================+
| buf | 8 bytes
+----------------+
| size | 4 bytes
| size | 8 bytes
+----------------+
| max_size | 4 bytes
| max_size | 8 bytes
+----------------+
| seq | 4 bytes
+----------------+
| padding | 4 bytes
+----------------+
| buf[0] | 1 byte
+----------------+
| buf[1] | 1 byte
+----------------+
+ ... | 1 byte
| ... | 1 byte
+----------------+
+ buf[max_size-1]| 1 byte
| buf[max_size-1]| 1 byte
+================+
*/
typedef struct recv_buf_flat {
Expand Down
11 changes: 7 additions & 4 deletions lab3/starter/cURL_IPC/main_2proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,25 @@
Here is the memory layout.
Note that the memory is a chunk of continuous bytes.
On a 64-bit machine, the memory layout is as follows:
+================+
| buf | 8 bytes
+----------------+
| size | 4 bytes
| size | 8 bytes
+----------------+
| max_size | 4 bytes
| max_size | 8 bytes
+----------------+
| seq | 4 bytes
+----------------+
| padding | 4 bytes
+----------------+
| buf[0] | 1 byte
+----------------+
| buf[1] | 1 byte
+----------------+
+ ... | 1 byte
| ... | 1 byte
+----------------+
+ buf[max_size-1]| 1 byte
| buf[max_size-1]| 1 byte
+================+
*/
typedef struct recv_buf_flat {
Expand Down

0 comments on commit 3acb111

Please sign in to comment.