diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-02 18:47:39 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-02 18:47:39 -0400 |
| commit | 61e482f6f36aee6f72392a6188f2ec5c858b88fd (patch) | |
| tree | bea4123fcc62dd834405ae89ce9fe260e90a0023 /builtins/memory.c | |
| parent | f0f8f218703ebb4512b3cd3f9e06b86a7d9861b0 (diff) | |
Initial WIP first past
Diffstat (limited to 'builtins/memory.c')
| -rw-r--r-- | builtins/memory.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtins/memory.c b/builtins/memory.c index 5b9f39ad..4e8e4c50 100644 --- a/builtins/memory.c +++ b/builtins/memory.c @@ -1,6 +1,5 @@ // Type info and methods for "Memory" opaque type #include <gc.h> -#include <gc/cord.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> @@ -8,17 +7,16 @@ #include <sys/param.h> #include <err.h> -#include "util.h" #include "halfsiphash.h" #include "memory.h" +#include "text.h" #include "types.h" +#include "util.h" -public CORD Memory__as_text(const void *p, bool colorize, const TypeInfo *type) { +public Text_t Memory__as_text(const void *p, bool colorize, const TypeInfo *type) { (void)type; - if (!p) return "Memory"; - CORD cord; - CORD_sprintf(&cord, colorize ? "\x1b[0;34;1mMemory<%p>\x1b[m" : "Memory<%p>", p); - return cord; + if (!p) return Text$from_str("Memory"); + return Text$format(colorize ? "\x1b[0;34;1mMemory<%p>\x1b[m" : "Memory<%p>", p); } public const TypeInfo $Memory = { |
