aboutsummaryrefslogtreecommitdiff
path: root/stdlib/memory.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
commit4b5e4cd1f21582f5e5fa682ab4e4bff252963468 (patch)
treee8fecb01f444c1d392c09255adba5cf6b312b326 /stdlib/memory.c
parent0b0e0a0a1d41e9574de8dc17c688a4894c5e7f92 (diff)
Change how types handle metamethods
Diffstat (limited to 'stdlib/memory.c')
-rw-r--r--stdlib/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/stdlib/memory.c b/stdlib/memory.c
index 17b6172f..70ca574c 100644
--- a/stdlib/memory.c
+++ b/stdlib/memory.c
@@ -12,8 +12,7 @@
#include "types.h"
#include "util.h"
-public Text_t Memory__as_text(const void *p, bool colorize, const TypeInfo_t *type) {
- (void)type;
+public Text_t Memory$as_text(const void *p, bool colorize, const TypeInfo_t *) {
if (!p) return Text("Memory");
return Text$format(colorize ? "\x1b[0;34;1mMemory<%p>\x1b[m" : "Memory<%p>", p);
}
@@ -21,8 +20,9 @@ public Text_t Memory__as_text(const void *p, bool colorize, const TypeInfo_t *ty
public const TypeInfo_t Memory$info = {
.size=0,
.align=0,
- .tag=CustomInfo,
- .CustomInfo={.as_text=(void*)Memory__as_text},
+ .metamethods={
+ .as_text=Memory$as_text,
+ },
};
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0