diff options
author | pommicket <pommicket@gmail.com> | 2023-09-13 23:11:15 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-14 10:47:51 -0400 |
commit | 52015e0c9a4e3bc8dc558929a85461f079dda303 (patch) | |
tree | bfdf9bda87934dbd96d4da1e87454d22184545b7 /ds.h | |
parent | e33379bab95031555ed5459ee8a73672f24fd0a0 (diff) |
batch write requests, fix tiny memory leak in ide-autocomplete
Diffstat (limited to 'ds.h')
-rw-r--r-- | ds.h | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -28,9 +28,20 @@ IMPORTANT NOTE: If you are using this with structures containing `long double`s, #include <stdint.h> #include <stdlib.h> #include <string.h> - -typedef uint32_t u32; -typedef uint8_t u8; +#include <stdarg.h> +#include <stddef.h> + +#ifndef SHORT_FIXED_SIZE_TYPES + typedef uint8_t u8; + typedef uint16_t u16; + typedef uint32_t u32; + typedef uint64_t u64; + typedef int8_t i8; + typedef int16_t i16; + typedef int32_t i32; + typedef int64_t i64; + #define SHORT_FIXED_SIZE_TYPES +#endif typedef union { long num; @@ -407,7 +418,7 @@ static void str_builder_append_null(StrBuilder *builder, size_t n) { arr_set_len(builder->str, arr_len(builder->str) + n); } -static u32 str_builder_len(StrBuilder *builder) { +static u32 str_builder_len(const StrBuilder *builder) { assert(builder->str); return arr_len(builder->str) - 1; } |