Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/prism/internal/stringy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@

#include "prism/stringy.h"

/*
* Backing storage for an empty string.
*/
static const uint8_t empty_source[] = "";

/*
* Defines an empty string. This is useful for initializing a string that will
* be filled in later.
*/
#define PM_STRING_EMPTY ((pm_string_t) { .type = PM_STRING_CONSTANT, .source = NULL, .length = 0 })
#define PM_STRING_EMPTY ((pm_string_t) { .type = PM_STRING_CONSTANT, .source = empty_source, .length = 0 })

/*
* Initialize a shared string that is based on initial input.
Expand Down
Loading