summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cpque.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/cpque.h')
-rw-r--r--include/stc/cpque.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/stc/cpque.h b/include/stc/cpque.h
index de509710..6819948f 100644
--- a/include/stc/cpque.h
+++ b/include/stc/cpque.h
@@ -60,6 +60,11 @@ STC_INLINE void cx_memb(_clear)(Self* self) {
STC_INLINE void cx_memb(_del)(Self* self)
{ cx_memb(_clear)(self); c_free(self->data); }
+STC_INLINE void cx_memb(_copy)(Self *self, Self other) {
+ if (self->data == other.data) return;
+ cx_memb(_del)(self); *self = cx_memb(_clone)(other);
+}
+
STC_INLINE size_t cx_memb(_size)(Self q)
{ return q.size; }