1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

Property [Inline] changes, large container/string fixes, reload fixes

This commit is contained in:
Brian Fiete 2019-12-09 10:28:56 -08:00
parent c531ade968
commit becd673914
9 changed files with 45 additions and 37 deletions

View file

@ -102,7 +102,7 @@ namespace System
}
}
[AttributeUsage(.Method /*1*/ | .Invocation | .Property)]
[AttributeUsage(.Method /*1*/ | .Invocation)]
public struct InlineAttribute : Attribute
{

View file

@ -15,15 +15,15 @@ namespace System
mValue = value;
}
[Inline]
public bool HasValue
{
[Inline]
get { return mHasValue; }
}
[Inline]
public T Value
{
[Inline]
get
{
if (!mHasValue)
@ -35,9 +35,9 @@ namespace System
}
}
[Inline]
public ref T ValueRef
{
[Inline]
get mut
{
if (!mHasValue)

View file

@ -50,65 +50,67 @@ namespace System
{
return Span<T>(array);
}
[Inline]
public int Length
{
[Inline]
get
{
return mLength;
}
[Inline]
set mut
{
mLength = value;
}
}
[Inline]
public T* Ptr
{
[Inline]
get
{
return mPtr;
}
[Inline]
set mut
{
mPtr = value;
}
}
[Inline]
public T* EndPtr
{
[Inline]
get
{
return mPtr + mLength;
}
}
[Inline]
public bool IsEmpty
{
[Inline]
get
{
return mLength == 0;
}
}
[Inline]
public bool IsNull
{
[Inline]
get
{
return mPtr == null;
}
}
[Inline]
public ref T this[int index]
{
[Inline]
get
{
return ref mPtr[index];
@ -331,10 +333,10 @@ namespace System
return OptSpan<T>(array);
}
[Inline]
public T* Ptr
{
[Inline]
get
{
return mPtr;

View file

@ -685,7 +685,7 @@ namespace System
void Realloc(int newSize)
{
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint_strsize)newSize <= cSizeFlags);
Debug.Assert((uint)newSize <= cSizeFlags);
char8* newPtr = new:this char8[newSize]*;
Internal.MemCpy(newPtr, Ptr, mLength);
if (IsDynAlloc)
@ -703,7 +703,7 @@ namespace System
void Realloc(char8* newPtr, int newSize)
{
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint_strsize)newSize <= cSizeFlags);
Debug.Assert((uint)newSize <= cSizeFlags);
Internal.MemCpy(newPtr, Ptr, mLength);
if (IsDynAlloc)
delete:this mPtr;