初始化alloc成员

This commit is contained in:
邹晓航
2014-09-17 10:11:03 +08:00
parent d8748d5c54
commit 67f6bedb15
3 changed files with 10 additions and 0 deletions

View File

@@ -44,6 +44,12 @@ namespace TinySTL{
static void *reallocate(void *ptr, size_t old_sz, size_t new_sz); static void *reallocate(void *ptr, size_t old_sz, size_t new_sz);
}; };
char *alloc::start_free = 0;
char *alloc::end_free = 0;
size_t alloc::heap_size = 0;
alloc::obj *alloc::free_list[alloc::ENFreeLists::NFREELISTS] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
} }
#endif #endif

View File

@@ -79,6 +79,7 @@
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Alloc.h" />
<ClInclude Include="Construct.h" /> <ClInclude Include="Construct.h" />
<ClInclude Include="TypeTraits.h" /> <ClInclude Include="TypeTraits.h" />
</ItemGroup> </ItemGroup>

View File

@@ -26,5 +26,8 @@
<ClInclude Include="Construct.h"> <ClInclude Include="Construct.h">
<Filter>头文件</Filter> <Filter>头文件</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Alloc.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>