This commit is contained in:
Remco
2016-03-30 20:37:25 +02:00
parent c75ba7a06e
commit eb17dbebef
4 changed files with 41 additions and 0 deletions
+2
View File
@@ -142,10 +142,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\Desktop\ipac\source\heap.c" />
<ClCompile Include="llist.c" />
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\Desktop\ipac\include\heap.h" />
<ClInclude Include="llist.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
@@ -3,8 +3,10 @@
<ItemGroup>
<ClCompile Include="llist.c" />
<ClCompile Include="main.c" />
<ClCompile Include="..\..\..\..\..\Desktop\ipac\source\heap.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="llist.h" />
<ClInclude Include="..\..\..\..\..\Desktop\ipac\include\heap.h" />
</ItemGroup>
</Project>
+31
View File
@@ -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());
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef HEAP_DEF
#define HEAP_DEF
void check_heap(void);
#endif