heap
This commit is contained in:
@@ -142,10 +142,12 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\..\..\..\Desktop\ipac\source\heap.c" />
|
||||||
<ClCompile Include="llist.c" />
|
<ClCompile Include="llist.c" />
|
||||||
<ClCompile Include="main.c" />
|
<ClCompile Include="main.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\..\..\..\Desktop\ipac\include\heap.h" />
|
||||||
<ClInclude Include="llist.h" />
|
<ClInclude Include="llist.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="llist.c" />
|
<ClCompile Include="llist.c" />
|
||||||
<ClCompile Include="main.c" />
|
<ClCompile Include="main.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\Desktop\ipac\source\heap.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="llist.h" />
|
<ClInclude Include="llist.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\Desktop\ipac\include\heap.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/*Dit is de C file om aan te tonen dat de heap verandert,
|
||||||
|
wanneer de double linked list wordt aangepast*/
|
||||||
|
|
||||||
|
#include "llist.h"
|
||||||
|
#include <sys/heap.h>
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
|
void check_heap(void)
|
||||||
|
{
|
||||||
|
add(12,0);//voeg 12 toe aan het einde
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
add(13,0);//voeg 13 toe aan het einde
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
remove(1);//de voorste verwijderen, dus integer 12
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
add(11,1);//voeg 11 toe aan het begin
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
add(14,1);//voeg 14 toe aan het begin
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
add(15,0);//voeg 15 toe aan het begin
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
removePos(2);//verwijder positie 1, dus integer 11
|
||||||
|
printf("Heapsize: %d\n",NutHeapAvailable());
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef HEAP_DEF
|
||||||
|
#define HEAP_DEF
|
||||||
|
|
||||||
|
void check_heap(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user