diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-22 20:16:30 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-22 20:16:30 -0300 |
commit | ae003d1854021bdbc3128b2752198761d06772fd (patch) | |
tree | 2cfbeaeb275b951341c1e4314825ddf1d68c1e89 /point.c | |
parent | de0a7c2e5e2a060057428547c786b5bbd51325bc (diff) | |
download | jet-ae003d1854021bdbc3128b2752198761d06772fd.tar.gz jet-ae003d1854021bdbc3128b2752198761d06772fd.zip |
Refactor page structure
Changed the page's memory alignment to hopefully use less space.
Also renamed buffer to elements.
Diffstat (limited to 'point.c')
-rw-r--r-- | point.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -15,7 +15,7 @@ uint16_t index_to_offset(struct point *point) { } uint8_t element(struct point *point) { - return point->page->buffer[index_to_offset(point)]; + return point->page->elements[index_to_offset(point)]; } bool at_eof(struct point *point) { @@ -60,7 +60,7 @@ void insert_at_point(struct point *point, uint8_t c) { } } align_gap(point); - point->page->buffer[point->page->gap_start] = c; + point->page->elements[point->page->gap_start] = c; point->page->gap_start++; point->page->element_count++; move_point_forward(point); |