From 78ba677b59a8cecd69f733fca1a37ad01b38320f Mon Sep 17 00:00:00 2001 From: tylov Date: Mon, 24 Jul 2023 22:57:44 +0200 Subject: Updated and fixed benchmarks and performance graphs. --- include/stc/cstack.h | 2 +- include/stc/cvec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/stc/cstack.h b/include/stc/cstack.h index f8640ed1..8fb176e1 100644 --- a/include/stc/cstack.h +++ b/include/stc/cstack.h @@ -103,7 +103,7 @@ STC_INLINE bool _cx_MEMB(_reserve)(_cx_Self* self, intptr_t n) { STC_INLINE _cx_value* _cx_MEMB(_append_uninit)(_cx_Self *self, intptr_t n) { intptr_t len = self->_len; - if (!_cx_MEMB(_reserve)(self, len + n)) return NULL; + if (!_cx_MEMB(_reserve)(self, len*3/2 + n)) return NULL; self->_len += n; return self->data + len; } diff --git a/include/stc/cvec.h b/include/stc/cvec.h index d08e382f..774f0582 100644 --- a/include/stc/cvec.h +++ b/include/stc/cvec.h @@ -316,7 +316,7 @@ _cx_MEMB(_resize)(_cx_Self* self, const intptr_t len, i_key null) { STC_DEF _cx_value* _cx_MEMB(_push)(_cx_Self* self, i_key value) { if (self->_len == self->_cap) - if (!_cx_MEMB(_reserve)(self, self->_len*3/2 + 4)) + if (!_cx_MEMB(_reserve)(self, self->_len*2 + 4)) return NULL; _cx_value *v = self->data + self->_len++; *v = value; -- cgit v1.2.3