The goal of the "autostr-and-garbage" branch is to refactor ddstring_t into a proper Str class. It will be accompanied by AutoStr, which is essentially an alias for Str but its instances will be automatically trashed at construction time. The next garbage collection will delete the string.
The primary uses for AutoStr are:
1) String variables with limited scope (e.g., inside a function) where it is convenient not to need to worry about deleting the string instances. There are many places where string manipulation is unnecessarily inconvenient due to manual construction and destruction.
2) Temporary return values that the caller doesn't have to release (e.g., Uri_Resolved()).
AutoStr can be converted back to a normal Str either by duplicating the string (Str_Duplicate()) or reclaiming it from the garbage (via Garbage_Untrash()).
Just putting this away for now; I will pick this up after the Candidate phase is done.
Started branch for ddstring_t refactoring
The goal of the "autostr-and-garbage" branch is to refactor
ddstring_t into a proper Str class. It will be accompanied
by AutoStr, which is essentially an alias for Str but its
instances will be automatically trashed at construction time.
The next garbage collection will delete the string.
The primary uses for AutoStr are:
1) String variables with limited scope (e.g., inside a
function) where it is convenient not to need to worry
about deleting the string instances. There are many
places where string manipulation is unnecessarily
inconvenient due to manual construction and destruction.
2) Temporary return values that the caller doesn't have
to release (e.g., Uri_Resolved()).
AutoStr can be converted back to a normal Str either by
duplicating the string (Str_Duplicate()) or reclaiming it
from the garbage (via Garbage_Untrash()).
Just putting this away for now; I will pick this up after
the Candidate phase is done.