tinygo/runtime/runtime.h
Ayke van Laethem 60a01a43a3 Implement strings the way Go itself does
This makes string slicing cheap.
2018-04-14 19:24:21 +02:00

11 строки
238 Б
C

#pragma once
#include <stdint.h>
typedef struct {
uint32_t len; // TODO: size_t (or, let max string size depend on target/flag)
uint8_t *buf; // points to string buffer itself
} string_t;
typedef int32_t intgo_t; // may be 64-bit