summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/rawptr_elements.c
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 /misc/examples/rawptr_elements.c
parent3cb564e7274b7749531742fa7c50fd928fdbe2d9 (diff)
downloadSTC-modified-ca54204557669fb54f43959594ee92109fcc75b6.tar.gz
STC-modified-ca54204557669fb54f43959594ee92109fcc75b6.zip
Added custom allocator per container type.
Diffstat (limited to 'misc/examples/rawptr_elements.c')
-rw-r--r--misc/examples/rawptr_elements.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/rawptr_elements.c b/misc/examples/rawptr_elements.c
index 96a9ba86..6fb9208c 100644
--- a/misc/examples/rawptr_elements.c
+++ b/misc/examples/rawptr_elements.c
@@ -10,9 +10,9 @@ typedef int64_t inttype;
#define i_key_str
#define i_val inttype*
#define i_valraw inttype
-#define i_valfrom(raw) c_NEW(inttype, raw)
+#define i_valfrom(raw) c_new(inttype, raw)
#define i_valto(x) **x
-#define i_valclone(x) c_NEW(inttype, *x)
+#define i_valclone(x) c_new(inttype, *x)
#define i_valdrop(x) c_free(*x)
#include <stc/cmap.h>
@@ -32,8 +32,8 @@ int main()
c_AUTO (SIBoxMap, m2)
{
printf("\nMap with pointer elements:\n");
- SIPtrMap_insert(&map, cstr_from("testing"), c_NEW(inttype, 1));
- SIPtrMap_insert(&map, cstr_from("done"), c_NEW(inttype, 2));
+ SIPtrMap_insert(&map, cstr_from("testing"), c_new(inttype, 1));
+ SIPtrMap_insert(&map, cstr_from("done"), c_new(inttype, 2));
// Emplace: implicit key, val construction:
SIPtrMap_emplace(&map, "hello", 3);