提交 7944934d authored 作者: Shane Bryldt's avatar Shane Bryldt

FS-10167: Fixed bug with ks_pool_resize allocating incorrectly based on recent…

FS-10167: Fixed bug with ks_pool_resize allocating incorrectly based on recent allocation code changes. Added some missing files as well from prior commits related to libblade test projects and windows VS project property files.
上级 7861bb0d
...@@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "..\win32\libso ...@@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "..\win32\libso
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "..\win32\libconfig\libconfig.2015.vcxproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "..\win32\libconfig\libconfig.2015.vcxproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blades", "test\blades.vcxproj", "{636D5B57-FC64-4A18-8D42-54209F8886BD}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
...@@ -141,6 +143,22 @@ Global ...@@ -141,6 +143,22 @@ Global
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32 {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32 {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x64.ActiveCfg = Debug|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x64.Build.0 = Debug|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x86.ActiveCfg = Debug|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x86.Build.0 = Debug|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x64.ActiveCfg = Debug|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x64.Build.0 = Debug|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x86.ActiveCfg = Debug|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x86.Build.0 = Debug|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x64.ActiveCfg = Release|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x64.Build.0 = Release|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x86.ActiveCfg = Release|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x86.Build.0 = Release|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x64.ActiveCfg = Release|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x64.Build.0 = Release|x64
{636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x86.ActiveCfg = Release|Win32
{636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
KS_BEGIN_EXTERN_C KS_BEGIN_EXTERN_C
#ifndef config_lookup_from #ifdef _WIN32
#define config_lookup_from config_setting_lookup #define config_lookup_from config_setting_lookup
#endif #endif
......
差异被折叠。
...@@ -1833,7 +1833,34 @@ KS_DECLARE(void *) ks_pool_resize_ex(ks_pool_t *mp_p, void *old_addr, const unsi ...@@ -1833,7 +1833,34 @@ KS_DECLARE(void *) ks_pool_resize_ex(ks_pool_t *mp_p, void *old_addr, const unsi
return NULL; return NULL;
} }
old_byte_size = prefix->size; old_byte_size = prefix->size - PREFIX_SIZE - FENCE_SIZE - prefix->padding;
if (old_byte_size == new_byte_size) {
SET_POINTER(error_p, KS_STATUS_SUCCESS);
new_addr = old_addr;
goto end;
}
if (old_byte_size >= new_byte_size) {
unsigned long diff = old_byte_size - new_byte_size;
//prefix->size -= diff;
prefix->padding += diff;
write_magic((char *)prefix + prefix->size - prefix->padding - FENCE_SIZE);
SET_POINTER(error_p, KS_STATUS_SUCCESS);
new_addr = old_addr;
goto end;
}
{
unsigned long diff = new_byte_size - old_byte_size;
if (prefix->padding >= diff) {
prefix->padding -= diff;
write_magic((char *)prefix + prefix->size - prefix->padding - FENCE_SIZE);
SET_POINTER(error_p, KS_STATUS_SUCCESS);
new_addr = old_addr;
goto end;
}
}
/* /*
* If the size is larger than a block then the allocation must be at * If the size is larger than a block then the allocation must be at
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<ConfigVersion>1.5</ConfigVersion>
</PropertyGroup>
<PropertyGroup>
<ConfigVersionImported>true</ConfigVersionImported>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="ConfigVersion">
<Value>$(ConfigVersion)</Value>
</BuildMacro>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="config-version.props" Condition=" '$(ConfigVersionImported)' == ''"/>
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<ConfigPropsImported>true</ConfigPropsImported>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\libconfig-$(ConfigVersion)\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<SodiumVersion>1.0.12</SodiumVersion>
</PropertyGroup>
<PropertyGroup>
<SodiumVersionImported>true</SodiumVersionImported>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="SodiumVersion">
<Value>$(SodiumVersion)</Value>
</BuildMacro>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="sodium-version.props" Condition=" '$(SodiumVersionImported)' == ''"/>
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<SodiumPropsImported>true</SodiumPropsImported>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\libsodium-$(SodiumVersion)\src\libsodium\include\sodium;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NATIVE_LITTLE_ENDIAN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论