mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Leave append buffers uninitialized
This commit is contained in:
parent
5fe3591bd7
commit
649aabcaee
1 changed files with 16 additions and 16 deletions
|
@ -72,7 +72,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ namespace System
|
|||
{
|
||||
let bufferSize = 16 - sizeof(char8*);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace System
|
|||
let count = str.mLength;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
Internal.MemCpy(Ptr, str.Ptr, count);
|
||||
mLength = count;
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
|
@ -106,7 +106,7 @@ namespace System
|
|||
let count = str.mLength - offset;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = str.Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
|
@ -123,7 +123,7 @@ namespace System
|
|||
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = str.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -137,7 +137,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
ptr[i] = c;
|
||||
|
@ -151,7 +151,7 @@ namespace System
|
|||
let count = Internal.CStrLen(char8Ptr);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
ptr[i] = char8Ptr[i];
|
||||
|
@ -164,7 +164,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
ptr[i] = char8Ptr[i];
|
||||
|
@ -178,7 +178,7 @@ namespace System
|
|||
let count = UTF16.GetLengthAsUTF8(char16Ptr);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
UTF16.Decode(char16Ptr, this);
|
||||
|
@ -190,7 +190,7 @@ namespace System
|
|||
let count = UTF16.GetLengthAsUTF8(chars);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
UTF16.Decode(chars, this);
|
||||
|
@ -202,7 +202,7 @@ namespace System
|
|||
let tryBufferSize = strView.Length - sizeof(char8*);
|
||||
let bufferSize = (tryBufferSize >= 0) ? tryBufferSize : 0;
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
Internal.MemCpy(ptr, strView.Ptr, strView.Length);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
|
@ -215,7 +215,7 @@ namespace System
|
|||
let count = strView.Length + (flags.HasFlag(.NullTerminate) ? 1 : 0);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
Internal.MemCpy(ptr, strView.Ptr, strView.Length);
|
||||
if (flags.HasFlag(.NullTerminate))
|
||||
|
@ -232,7 +232,7 @@ namespace System
|
|||
let count = strView.Length - offset;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = strView.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -249,7 +249,7 @@ namespace System
|
|||
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = strView.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -263,7 +263,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
ptr[i] = chars[i + offset];
|
||||
|
@ -285,7 +285,7 @@ namespace System
|
|||
int count = StrLengths(strs);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
int curIdx = 0;
|
||||
for (var str in strs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue