summaryrefslogtreecommitdiffhomepage
path: root/include/stc/priv/template.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-07 12:30:39 +0100
committerTyge Løvset <[email protected]>2023-02-07 12:30:39 +0100
commitca54204557669fb54f43959594ee92109fcc75b6 (patch)
tree9880ad3d7e3dca7e309e0b96f5c88ebbb0552853 /include/stc/priv/template.h
parent3cb564e7274b7749531742fa7c50fd928fdbe2d9 (diff)
downloadSTC-modified-ca54204557669fb54f43959594ee92109fcc75b6.tar.gz
STC-modified-ca54204557669fb54f43959594ee92109fcc75b6.zip
Added custom allocator per container type.
Diffstat (limited to 'include/stc/priv/template.h')
-rw-r--r--include/stc/priv/template.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/stc/priv/template.h b/include/stc/priv/template.h
index 6eb82bcb..79627ff3 100644
--- a/include/stc/priv/template.h
+++ b/include/stc/priv/template.h
@@ -48,6 +48,16 @@
#define i_size intptr_t
#endif
+#ifndef i_allocator
+ #define i_allocator c_
+#endif
+#ifndef i_malloc
+ #define i_malloc c_PASTE(i_allocator, malloc)
+ #define i_calloc c_PASTE(i_allocator, calloc)
+ #define i_realloc c_PASTE(i_allocator, realloc)
+ #define i_free c_PASTE(i_allocator, free)
+#endif
+
#if !(defined i_key || defined i_key_str || defined i_key_ssv || \
defined i_keyclass || defined i_keyboxed)
#if defined _i_ismap
@@ -317,6 +327,12 @@
#undef i_static
#undef i_extern
+#undef i_allocator
+#undef i_malloc
+#undef i_calloc
+#undef i_realloc
+#undef i_free
+
#undef i_no_cmp
#undef i_no_eq
#undef i_no_hash