Skip to content

Commit

Permalink
Fix error in part3.md
Browse files Browse the repository at this point in the history
Co-Authored-By: kodemartin <kodemartin@protonmail.ch>
  • Loading branch information
cstack and kodemartin authored Apr 17, 2019
1 parent c7074b0 commit ea1152c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _parts/part3.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Speaking of which, here is how we figure out where to read/write in memory for a
+void* row_slot(Table* table, uint32_t row_num) {
+ uint32_t page_num = row_num / ROWS_PER_PAGE;
+ void* page = table->pages[page_num];
+ if (page = NULL) {
+ if (page == NULL) {
+ // Allocate memory only when we try to access page
+ page = table->pages[page_num] = malloc(PAGE_SIZE);
+ }
Expand Down

0 comments on commit ea1152c

Please sign in to comment.