diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-10-23 21:19:29 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-10-23 21:19:29 +0000 |
| commit | aff68e74222f03d36abdfb2e0ebb5c3f98e95df8 (patch) | |
| tree | 8077f1cd063615236ce1591d4ca75c771bec20c1 /src/runtime/c/gu/seq.c | |
| parent | 3aaeb7a156e95e2f851e9edcef16b9fa1a465858 (diff) | |
inline a number of functions in gu/seq.c. this has a noticeable effect on the parser's speed
Diffstat (limited to 'src/runtime/c/gu/seq.c')
| -rw-r--r-- | src/runtime/c/gu/seq.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/runtime/c/gu/seq.c b/src/runtime/c/gu/seq.c index 65d1b945c..0bff675ac 100644 --- a/src/runtime/c/gu/seq.c +++ b/src/runtime/c/gu/seq.c @@ -7,30 +7,6 @@ #include <malloc.h> #endif -struct GuSeq { - size_t len; - uint8_t data[0]; -}; - -struct GuBuf { - GuSeq* seq; - size_t elem_size; - size_t avail_len; - GuFinalizer fin; -}; - -size_t -gu_buf_length(GuBuf* buf) -{ - return buf->seq->len; -} - -size_t -gu_buf_avail(GuBuf* buf) -{ - return buf->avail_len; -} - static void gu_buf_fini(GuFinalizer* fin) { @@ -51,18 +27,6 @@ gu_make_buf(size_t elem_size, GuPool* pool) return buf; } -size_t -gu_seq_length(GuSeq* seq) -{ - return seq->len; -} - -void* -gu_seq_data(GuSeq* seq) -{ - return seq->data; -} - static GuSeq gu_empty_seq_ = {0}; GuSeq* @@ -130,18 +94,6 @@ gu_buf_require(GuBuf* buf, size_t req_len) } void* -gu_buf_data(GuBuf* buf) -{ - return &buf->seq->data; -} - -GuSeq* -gu_buf_data_seq(GuBuf* buf) -{ - return buf->seq; -} - -void* gu_buf_extend_n(GuBuf* buf, size_t n_elems) { size_t len = gu_buf_length(buf); @@ -151,12 +103,6 @@ gu_buf_extend_n(GuBuf* buf, size_t n_elems) return &buf->seq->data[buf->elem_size * len]; } -void* -gu_buf_extend(GuBuf* buf) -{ - return gu_buf_extend_n(buf, 1); -} - void gu_buf_push_n(GuBuf* buf, const void* data, size_t n_elems) { @@ -173,18 +119,6 @@ gu_buf_trim_n(GuBuf* buf, size_t n_elems) return &buf->seq->data[buf->elem_size * new_len]; } -const void* -gu_buf_trim(GuBuf* buf) -{ - return gu_buf_trim_n(buf, 1); -} - -void -gu_buf_flush(GuBuf* buf) -{ - buf->seq->len = 0; -} - void gu_buf_pop_n(GuBuf* buf, size_t n_elems, void* data_out) { |
