Fixing tests, Fixed buffer dealloc bug, fixed clipboard bug
This commit is contained in:
@@ -321,7 +321,7 @@ API void *BlockArenaAllocatorProc(void *object, int kind, void *p, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void TestArena() {
|
||||
void RunArenaTest() {
|
||||
Allocator memory_tracking_allocator = GetTrackingAllocator();
|
||||
{
|
||||
BlockArena arena = {};
|
||||
|
||||
@@ -185,7 +185,7 @@ API String16 TrimEnd(String16 string) {
|
||||
|
||||
API String16 Copy16(Allocator allocator, String16 string) {
|
||||
char16_t *copy = (char16_t *)AllocSize(allocator, sizeof(char16_t) * (string.len + 1));
|
||||
memcpy(copy, string.data, string.len);
|
||||
memcpy(copy, string.data, string.len * sizeof(char16_t));
|
||||
copy[string.len] = 0;
|
||||
String16 result = {copy, string.len};
|
||||
return result;
|
||||
@@ -332,10 +332,10 @@ API String16 Merge(Allocator allocator, Array<String16> list, String16 separator
|
||||
String16 string = {buff, 0};
|
||||
For(list) {
|
||||
Assert(string.len + it.len <= size);
|
||||
memcpy(string.data + string.len, it.data, it.len);
|
||||
memcpy(string.data + string.len, it.data, it.len * sizeof(char16_t));
|
||||
string.len += it.len;
|
||||
if (!IsLast(list, it)) {
|
||||
memcpy(string.data + string.len, separator.data, separator.len);
|
||||
memcpy(string.data + string.len, separator.data, separator.len * sizeof(char16_t));
|
||||
string.len += separator.len;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user