Replacing core allocation stuff, still need to rewrite map and token
structures
This commit is contained in:
@@ -76,8 +76,8 @@ operator==(String a, String b){
|
||||
}
|
||||
|
||||
function String
|
||||
string_copy(Allocator *a, String string){
|
||||
U8 *copy = exp_alloc_array(a, U8, string.len+1);
|
||||
string_copy(Arena *a, String string){
|
||||
U8 *copy = arena_push_array(a, U8, string.len+1);
|
||||
memory_copy(copy, string.str, string.len);
|
||||
copy[string.len] = 0;
|
||||
return String{copy, string.len};
|
||||
@@ -368,7 +368,7 @@ string_trim_end(String string) {
|
||||
}
|
||||
|
||||
function String
|
||||
string_to_lower_case(Allocator *arena, String s) {
|
||||
string_to_lower_case(Arena *arena, String s) {
|
||||
String copy = string_copy(arena, s);
|
||||
for (U64 i = 0; i < copy.len; i++) {
|
||||
copy.str[i] = to_lower_case(copy.str[i]);
|
||||
@@ -377,7 +377,7 @@ string_to_lower_case(Allocator *arena, String s) {
|
||||
}
|
||||
|
||||
function String
|
||||
string_to_upper_case(Allocator *arena, String s) {
|
||||
string_to_upper_case(Arena *arena, String s) {
|
||||
String copy = string_copy(arena, s);
|
||||
for (U64 i = 0; i < copy.len; i++) {
|
||||
copy.str[i] = to_upper_case(copy.str[i]);
|
||||
|
||||
Reference in New Issue
Block a user