Skip to content

Commit 66c7ffc

Browse files
Update README.md
1 parent 338b4ec commit 66c7ffc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ unsafe
3737
using (var memory = new Struct.StackMemory(sizeof(int) * 100))//Allocate memory for all your collections 400 byte.
3838
{
3939
{
40-
using var listOfInt32 = new Struct.ListOfInt32(50, &memory);//50 * 4 = 200 byte
40+
using var listOfInt32 = new Struct.ListOfInt32(2, &memory);//2 * 4 = 8 byte
41+
for(int i = 0; i< 48; i++)
42+
{
43+
listOfInt32.Add(in i);//+ 4 byte, shift index memory.Current by 4 byte: memory.Current +=4;
44+
}
45+
//listOfInt32 is 200 byte
4146
list.ExpandCapacity(50);// + 200 byte
4247
//Do whatever you want with list of Int32 items
4348
}//return memory

0 commit comments

Comments
 (0)