summaryrefslogtreecommitdiff
path: root/page.cpp
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-07-11 21:37:42 -0300
committerGitHub <noreply@github.com>2020-07-11 21:37:42 -0300
commit13fdfe875efdfb33d392c5e634ceff494962e7dc (patch)
tree48e6d89b63f9af3a14d2ef4564f1c7cdceef77d5 /page.cpp
parent880047d09eb4b9a448a5817699422abc6f07b5d6 (diff)
parent291748a56824f77b137c66e9879ec0a4ecb14ced (diff)
downloadjet-13fdfe875efdfb33d392c5e634ceff494962e7dc.tar.gz
jet-13fdfe875efdfb33d392c5e634ceff494962e7dc.zip
Merge pull request #10 from jmtomas/4
Diffstat (limited to 'page.cpp')
-rw-r--r--page.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/page.cpp b/page.cpp
index 6ded950..77cf686 100644
--- a/page.cpp
+++ b/page.cpp
@@ -1,8 +1,3 @@
-#include <stdint.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif
@@ -59,28 +54,24 @@ struct Page {
}
void move_gap_forward() {
- assert(gap_end < PAGE_SIZE);
elements[gap_start] = elements[gap_end];
gap_start++;
gap_end++;
}
void move_gap_backward() {
- assert(gap_start > 0);
gap_end--;
gap_start--;
elements[gap_end] = elements[gap_start];
}
void push(uint8_t c) {
- assert(element_count < PAGE_SIZE);
elements[gap_start] = c;
gap_start++;
element_count++;
}
void pop() {
- assert(gap_start > 0);
gap_start--;
element_count--;
}