nostrdb/nostr_bech32: only parse up to raw bech32 buffers
We will be storing raw nostr bech32 buffers directly into nostrdb, so adapt our bech32 code to reflect this. When doing our content parsing pass, we will only look for strings and we won't allocate any intermediate buffers. Only when we write this string block to nostrdb will we actually allocate in our nostrdb output buffer (no mallocs!) Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
30ba0d72cc
commit
aa5809d792
12
nostrdb/src/str_block.h
Normal file
12
nostrdb/src/str_block.h
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
#ifndef NDB_STR_BLOCK_H
|
||||
#define NDB_STR_BLOCK_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
struct str_block {
|
||||
const char *str;
|
||||
uint32_t len;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user