..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h\r
EndProjectSection\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-map", "hdr-test-map.vcxproj", "{282E9A9A-386A-40FB-A483-994BACE24830}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81}\r
- {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
- EndProjectSection\r
-EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-misc", "hdr-test-misc.vcxproj", "{C5E76975-B87B-4B9E-8596-B01DDA683FCA}"\r
ProjectSection(ProjectDependencies) = postProject\r
{61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81}\r
{77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|Win32.Build.0 = Release|Win32\r
{77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|x64.ActiveCfg = Release|x64\r
{77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|x64.Build.0 = Release|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|Win32.Build.0 = Debug|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|x64.ActiveCfg = Debug|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|x64.Build.0 = Debug|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Release|Win32.ActiveCfg = Release|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Release|Win32.Build.0 = Release|Win32\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Release|x64.ActiveCfg = Release|x64\r
- {282E9A9A-386A-40FB-A483-994BACE24830}.Release|x64.Build.0 = Release|x64\r
{C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|Win32.ActiveCfg = Debug|Win32\r
{C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|Win32.Build.0 = Debug|Win32\r
{C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|x64.ActiveCfg = Debug|x64\r
GlobalSection(NestedProjects) = preSolution\r
{61179F2F-07E1-490D-B64D-D85A90B6EF81} = {B30CA283-1796-4763-92C3-2E4848D443F7}\r
{77350FDC-9E51-438B-9A8F-D2FEA11D46B2} = {B30CA283-1796-4763-92C3-2E4848D443F7}\r
- {282E9A9A-386A-40FB-A483-994BACE24830} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}\r
{C5E76975-B87B-4B9E-8596-B01DDA683FCA} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}\r
{6BB7A27F-FC59-4267-B6FA-D034176D1459} = {B30CA283-1796-4763-92C3-2E4848D443F7}\r
{A64449B7-90FB-4E2B-A686-9EFC0E298644} = {B30CA283-1796-4763-92C3-2E4848D443F7}\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="DebugVLD|Win32">\r
- <Configuration>DebugVLD</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="DebugVLD|x64">\r
- <Configuration>DebugVLD</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{282E9A9A-386A-40FB-A483-994BACE24830}</ProjectGuid>\r
- <RootNamespace>hdrtestmap</RootNamespace>\r
- <Keyword>Win32Proj</Keyword>\r
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</LinkIncremental>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(ProjectName)_d</TargetName>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- <Profile>true</Profile>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- <Profile>true</Profile>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_cuckoo_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_striped_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\print_skiplist_stat.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_cuckoo_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_flat_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_list.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_unordered_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_hashmap_std.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_list.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_slist.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_flat_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_list.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_unordered_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_hashmap_std.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_list.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_map.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_slist.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_map_reg.cpp" />\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_cuckoo_map.cpp">\r
- <Filter>cuckoo</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_hp.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_hp.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_nogc.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_nogc.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_flat_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_list.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_boost_unordered_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_hashmap_std.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_list.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_refinable_hashmap_slist.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_hp.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_hp.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_hp.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_nogc.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_nogc.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_flat_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_list.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_boost_unordered_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_hashmap_std.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_list.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_map.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_hashmap_slist.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpb.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpi.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_gpt.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpb.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpi.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_gpt.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpb.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpi.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_gpt.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpb.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpi.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_gpt.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpb.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpi.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_gpt.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_nogc.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_striped_map_reg.cpp">\r
- <Filter>striped</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_shb.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_rcu_sht.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_shb.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_rcu_sht.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_shb.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu_sht.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_shb.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_rcu_sht.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_shb.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_rcu_sht.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_dhp.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_michael_map_lazy_dhp.cpp">\r
- <Filter>michael</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_dhp.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_splitlist_map_lazy_dhp.cpp">\r
- <Filter>split_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_dhp.cpp">\r
- <Filter>skip_list</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_hp.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_dhp.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpb.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpi.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_gpt.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_shb.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap_rcu_sht.cpp">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\print_skiplist_stat.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map.h">\r
- <Filter>skip_list</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_skiplist_map_rcu.h">\r
- <Filter>skip_list</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_striped_map.h">\r
- <Filter>striped</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_cuckoo_map.h">\r
- <Filter>cuckoo</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\map\hdr_feldman_hashmap.h">\r
- <Filter>multilvel_hashmap</Filter>\r
- </ClInclude>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Filter Include="cuckoo">\r
- <UniqueIdentifier>{9cc8e982-b321-4a7d-8362-7f1491ad445d}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="michael">\r
- <UniqueIdentifier>{c524c47b-2087-42eb-b3b2-f70ed379e373}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="striped">\r
- <UniqueIdentifier>{33452d52-b86d-4143-9f87-bf154d53f890}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="skip_list">\r
- <UniqueIdentifier>{1f7bd2f3-a377-47a5-aaae-aaddd60cbedc}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="split_list">\r
- <UniqueIdentifier>{9318c3c0-92a3-4a5a-be2b-a47411a3e4c4}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="multilvel_hashmap">\r
- <UniqueIdentifier>{cf81877d-3069-48a6-a143-2281963e9c4f}</UniqueIdentifier>\r
- </Filter>\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
-CDS_TESTHDR_MAP := \
- tests/test-hdr/map/hdr_michael_map_hp.cpp \
- tests/test-hdr/map/hdr_michael_map_dhp.cpp \
- tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp \
- tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp \
- tests/test-hdr/map/hdr_michael_map_nogc.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp \
- tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp \
- tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_list.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_map.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp \
- tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp \
- tests/test-hdr/map/hdr_skiplist_map_hp.cpp \
- tests/test-hdr/map/hdr_skiplist_map_dhp.cpp \
- tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp \
- tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp \
- tests/test-hdr/map/hdr_skiplist_map_nogc.cpp \
- tests/test-hdr/map/hdr_splitlist_map_hp.cpp \
- tests/test-hdr/map/hdr_splitlist_map_dhp.cpp \
- tests/test-hdr/map/hdr_splitlist_map_nogc.cpp \
- tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp \
- tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp \
- tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_list.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_map.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp \
- tests/test-hdr/map/hdr_striped_hashmap_slist.cpp \
- tests/test-hdr/map/hdr_striped_map_reg.cpp
-
CDS_TESTHDR_TREE := \
tests/test-hdr/tree/hdr_tree_reg.cpp \
tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp.cpp \
tests/test-hdr/misc/thread_init_fini.cpp
CDS_TESTHDR_SOURCES := \
- $(CDS_TESTHDR_MAP) \
$(CDS_TESTHDR_TREE) \
$(CDS_TESTHDR_MISC)
-CDS_TESTHDR_OFFSETOF_MAP := \
- tests/test-hdr/map/hdr_cuckoo_map.cpp
-
CDS_TESTHDR_OFFSETOF_TREE := \
tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp_member.cpp \
tests/test-hdr/tree/hdr_intrusive_ellen_bintree_dhp_member.cpp \
tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp
CDS_TESTHDR_OFFSETOF_SOURCES := \
- $(CDS_TESTHDR_OFFSETOF_MAP) \
$(CDS_TESTHDR_OFFSETOF_TREE)
set(PACKAGE_NAME test-hdr)\r
\r
-set(CDS_TESTHDR_MAP\r
- map/hdr_michael_map_hp.cpp\r
- map/hdr_michael_map_dhp.cpp\r
- map/hdr_michael_map_rcu_gpi.cpp\r
- map/hdr_michael_map_rcu_gpb.cpp\r
- map/hdr_michael_map_rcu_gpt.cpp\r
- map/hdr_michael_map_rcu_shb.cpp\r
- map/hdr_michael_map_rcu_sht.cpp\r
- map/hdr_michael_map_nogc.cpp\r
- map/hdr_michael_map_lazy_hp.cpp\r
- map/hdr_michael_map_lazy_dhp.cpp\r
- map/hdr_michael_map_lazy_rcu_gpi.cpp\r
- map/hdr_michael_map_lazy_rcu_gpb.cpp\r
- map/hdr_michael_map_lazy_rcu_gpt.cpp\r
- map/hdr_michael_map_lazy_rcu_shb.cpp\r
- map/hdr_michael_map_lazy_rcu_sht.cpp\r
- map/hdr_michael_map_lazy_nogc.cpp\r
- map/hdr_feldman_hashmap_hp.cpp\r
- map/hdr_feldman_hashmap_dhp.cpp\r
- map/hdr_feldman_hashmap_rcu_gpb.cpp\r
- map/hdr_feldman_hashmap_rcu_gpi.cpp\r
- map/hdr_feldman_hashmap_rcu_gpt.cpp\r
- map/hdr_feldman_hashmap_rcu_shb.cpp\r
- map/hdr_feldman_hashmap_rcu_sht.cpp\r
- map/hdr_refinable_hashmap_hashmap_std.cpp\r
- map/hdr_refinable_hashmap_boost_list.cpp\r
- map/hdr_refinable_hashmap_list.cpp\r
- map/hdr_refinable_hashmap_map.cpp\r
- map/hdr_refinable_hashmap_boost_map.cpp\r
- map/hdr_refinable_hashmap_boost_flat_map.cpp\r
- map/hdr_refinable_hashmap_boost_unordered_map.cpp\r
- map/hdr_refinable_hashmap_slist.cpp\r
- map/hdr_skiplist_map_hp.cpp\r
- map/hdr_skiplist_map_dhp.cpp\r
- map/hdr_skiplist_map_rcu_gpi.cpp\r
- map/hdr_skiplist_map_rcu_gpb.cpp\r
- map/hdr_skiplist_map_rcu_gpt.cpp\r
- map/hdr_skiplist_map_rcu_shb.cpp\r
- map/hdr_skiplist_map_rcu_sht.cpp\r
- map/hdr_skiplist_map_nogc.cpp\r
- map/hdr_splitlist_map_hp.cpp\r
- map/hdr_splitlist_map_dhp.cpp\r
- map/hdr_splitlist_map_nogc.cpp\r
- map/hdr_splitlist_map_rcu_gpi.cpp\r
- map/hdr_splitlist_map_rcu_gpb.cpp\r
- map/hdr_splitlist_map_rcu_gpt.cpp\r
- map/hdr_splitlist_map_rcu_shb.cpp\r
- map/hdr_splitlist_map_rcu_sht.cpp\r
- map/hdr_splitlist_map_lazy_hp.cpp\r
- map/hdr_splitlist_map_lazy_dhp.cpp\r
- map/hdr_splitlist_map_lazy_nogc.cpp\r
- map/hdr_splitlist_map_lazy_rcu_gpi.cpp\r
- map/hdr_splitlist_map_lazy_rcu_gpb.cpp\r
- map/hdr_splitlist_map_lazy_rcu_gpt.cpp\r
- map/hdr_splitlist_map_lazy_rcu_sht.cpp\r
- map/hdr_splitlist_map_lazy_rcu_shb.cpp\r
- map/hdr_striped_hashmap_hashmap_std.cpp\r
- map/hdr_striped_hashmap_boost_list.cpp\r
- map/hdr_striped_hashmap_list.cpp\r
- map/hdr_striped_hashmap_map.cpp\r
- map/hdr_striped_hashmap_boost_map.cpp\r
- map/hdr_striped_hashmap_boost_flat_map.cpp\r
- map/hdr_striped_hashmap_boost_unordered_map.cpp\r
- map/hdr_striped_hashmap_slist.cpp\r
- map/hdr_striped_map_reg.cpp)\r
-\r
set(CDS_TESTHDR_TREE\r
tree/hdr_tree_reg.cpp
tree/hdr_intrusive_ellen_bintree_hp.cpp
misc/permutation_generator.cpp\r
misc/thread_init_fini.cpp)\r
\r
-set(CDS_TESTHDR_OFFSETOF_MAP\r
- map/hdr_cuckoo_map.cpp)\r
-\r
set(CDS_TESTHDR_OFFSETOF_TREE\r
tree/hdr_intrusive_ellen_bintree_hp_member.cpp\r
tree/hdr_intrusive_ellen_bintree_dhp_member.cpp\r
tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp)\r
\r
set(CDS_TESTHDR_OFFSETOF_SOURCES\r
- ${CDS_TESTHDR_OFFSETOF_MAP}\r
${CDS_TESTHDR_OFFSETOF_TREE})\r
\r
add_library(test-hdr-offsetof OBJECT ${CDS_TESTHDR_OFFSETOF_SOURCES})\r
endif(CMAKE_COMPILER_IS_GNUCC)\r
\r
set(CDS_TESTHDR_SOURCES\r
- ${CDS_TESTHDR_MAP}\r
${CDS_TESTHDR_TREE}\r
${CDS_TESTHDR_MISC})\r
\r
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_cuckoo_map.h"
-#include <cds/container/cuckoo_map.h>
-
-namespace map {
-
- namespace {
- typedef CuckooMapHdrTest::hash_int hash1;
- struct hash2: private hash1
- {
- typedef hash1 base_class;
-
- size_t operator()( int i ) const
- {
- size_t h = ~( base_class::operator()(i));
- return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
- }
- };
- }
-
- void CuckooMapHdrTest::Cuckoo_striped_list()
- {
- CPPUNIT_MESSAGE( "equal");
- {
- struct map_traits : public cc::cuckoo::traits {
- typedef std::equal_to<int> equal_to;
- typedef co::hash_tuple< hash1, hash2 > hash;
- };
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, map_traits > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- }
-
-
- void CuckooMapHdrTest::Cuckoo_striped_vector()
- {
- CPPUNIT_MESSAGE( "equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::striping<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::striping<> >
- ,co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
- }
-
-
- void CuckooMapHdrTest::Cuckoo_refinable_list()
- {
- CPPUNIT_MESSAGE( "equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::list >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- }
-
-
- void CuckooMapHdrTest::Cuckoo_refinable_vector()
- {
- CPPUNIT_MESSAGE( "equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< false >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,cc::cuckoo::store_hash< false >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to<int> >
- ,co::hash< std::tuple< hash1, hash2 > >
- ,co::mutex_policy< cc::cuckoo::refinable<> >
- ,cc::cuckoo::store_hash< false >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
-
- CPPUNIT_MESSAGE( "less+cmp+equal, store hash");
- {
- typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type,
- cc::cuckoo::make_traits<
- co::mutex_policy< cc::cuckoo::refinable<> >
- ,co::less< std::less<int> >
- ,co::compare< CuckooMapHdrTest::cmp >
- ,co::equal_to< std::equal_to< int > >
- ,cc::cuckoo::store_hash< true >
- ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
- ,co::hash< std::tuple< hash1, hash2 > >
- >::type
- > map_t;
-
- test_cuckoo<map_t>();
- }
- }
-
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::CuckooMapHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_CUCKOO_MAP_H
-#define CDSTEST_HDR_CUCKOO_MAP_H
-#include "size_check.h"
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/os/timer.h>
-#include <cds/opt/hash.h>
-#include <functional> // ref
-
-namespace cds { namespace container {}}
-
-namespace map {
- using misc::check_size;
-
- namespace cc = cds::container;
- namespace co = cds::opt;
-
- class CuckooMapHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct value_type {
- int m_val;
-
- value_type()
- : m_val(0)
- {}
-
- value_type( int n )
- : m_val( n )
- {}
-
- value_type( value_type&& v )
- : m_val( v.m_val )
- {}
-
- value_type( value_type const& v )
- : m_val( v.m_val )
- {}
-
- value_type& operator=( value_type const& v )
- {
- m_val = v.m_val;
- return *this;
- }
- };
-
- typedef std::pair<key_type const, value_type> pair_type;
-
- struct less
- {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 < v2;
- }
- };
-
- struct cmp {
- int operator ()(int v1, int v2 ) const
- {
- if ( v1 < v2 )
- return -1;
- return v1 > v2 ? 1 : 0;
- }
- };
-
- struct equal {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 == v2;
- }
- };
-
- struct hash_int {
- size_t operator()( int i ) const
- {
- return co::v::hash<int>()( i );
- }
- };
-
- struct simple_item_counter {
- size_t m_nCount;
-
- simple_item_counter()
- : m_nCount(0)
- {}
-
- size_t operator ++()
- {
- return ++m_nCount;
- }
-
- size_t operator --()
- {
- return --m_nCount;
- }
-
- void reset()
- {
- m_nCount = 0;
- }
-
- operator size_t() const
- {
- return m_nCount;
- }
- };
-
- template <typename Map>
- struct insert_functor
- {
- typedef typename Map::value_type pair_type;
-
- // insert ftor
- void operator()( pair_type& item )
- {
- item.second.m_val = item.first * 3;
- }
-
- // update() ftor
- void operator()( bool bNew, pair_type& item )
- {
- if ( bNew )
- item.second.m_val = item.first * 2;
- else
- item.second.m_val = item.first * 5;
- }
- };
-
- struct check_value {
- int m_nExpected;
-
- check_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- template <typename T>
- void operator ()( T& pair )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- template <typename T, typename Q>
- void operator ()( T& pair, Q )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- };
-
- struct extract_functor
- {
- int * m_pVal;
- void operator()( pair_type const& val )
- {
- *m_pVal = val.second.m_val;
- }
- };
-
- /*
- template <class Map>
- void test_iter( Map& s)
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- const int nMaxCount = 500;
- for ( int i = 0; i < nMaxCount; ++i ) {
- CPPUNIT_ASSERT( s.insert( i, i * 2 ));
- }
-
- int nCount = 0;
- for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first * 2 == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val );
- it->second.m_val = it->first;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
-
- Map const& refSet = s;
- nCount = 0;
- for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
- }
- */
-
-
- template <class Map>
- void test_cuckoo()
- {
- Map m( 32, 4, 3 );
- CPPUNIT_ASSERT( m.bucket_count() == 32 );
- CPPUNIT_ASSERT( m.lock_count() == 32 );
-
- test_cuckoo_with( m );
-
- // Iterators is not yet supported for CuckooMap
- //m.clear();
- //CPPUNIT_ASSERT( m.empty() );
- //CPPUNIT_ASSERT( check_size( m, 0 ));
- //test_iter(m);
- }
-
- //*******************************************
- // If erase_with && find_with are supported
- template <class Map>
- void test_int_with( Map& m )
- {
- std::pair<bool, bool> updateResult;
- typedef typename std::conditional< Map::c_isSorted, less, equal >::type predicate;
-
- // insert
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(25) );
-
- CPPUNIT_ASSERT( !m.insert( 25 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
-
- CPPUNIT_ASSERT( !m.contains(10, predicate()) );
- CPPUNIT_ASSERT( m.insert( 10, 10 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(10, predicate()) );
-
- CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
-
- CPPUNIT_ASSERT( !m.contains(30) );
- CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(30) );
-
- CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
-
- // update (new key)
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update(27, insert_functor<Map>(), false);
- CPPUNIT_ASSERT(!updateResult.first);
- CPPUNIT_ASSERT(!updateResult.second);
- CPPUNIT_ASSERT(!m.contains(27));
- updateResult = m.update( 27, insert_functor<Map>() ) ; // value = 54
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( m.contains(27) );
-
- // find test
- check_value chk(10);
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find_with( 25, predicate(), std::ref(chk) ));
- chk.m_nExpected = 90;
- CPPUNIT_ASSERT( m.find( 30, std::ref(chk) ));
- chk.m_nExpected = 54;
- CPPUNIT_ASSERT( m.find( 27, std::ref(chk) ));
-
- updateResult = m.update( 10, insert_functor<Map>() ) ; // value = 50
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- chk.m_nExpected = 50;
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
-
- // erase test
- CPPUNIT_ASSERT( !m.contains(100) );
- CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
-
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 25 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( !m.erase( 25 ));
-
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( m.insert(258))
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(258, predicate()) );
- CPPUNIT_ASSERT( m.erase_with( 258, predicate() ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( !m.erase_with( 258, predicate() ));
-
- int nVal;
- extract_functor ext;
- ext.m_pVal = &nVal;
-
- CPPUNIT_ASSERT( !m.contains(29) );
- CPPUNIT_ASSERT( m.insert(29, 290))
- CPPUNIT_ASSERT( m.erase_with( 29, predicate(), std::ref(ext)));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( nVal == 290 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( nVal == 90 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
- CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
- CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
-
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- chk.m_nExpected = 731;
- CPPUNIT_ASSERT( m.find_with( 137, predicate(), std::ref(chk) ));
- chk.m_nExpected = 941;
- CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
-
- CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- template <class Map>
- void test_cuckoo_with(Map& m)
- {
- cds::OS::Timer timer;
-
- test_int_with( m );
-
- // Iterators is not yet supported
- //m.clear();
- //CPPUNIT_ASSERT( m.empty() );
- //CPPUNIT_ASSERT( check_size( m, 0 ));
- //test_iter(m);
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // Resizing test
- for ( int i = 0; i < 40000; i++ ) {
- m.insert( i );
- }
-
- CPPUNIT_MSG( " Duration=" << timer.duration() );
- }
-
- void Cuckoo_striped_list();
- void Cuckoo_striped_vector();
- void Cuckoo_refinable_list();
- void Cuckoo_refinable_vector();
-
- CPPUNIT_TEST_SUITE(CuckooMapHdrTest)
- CPPUNIT_TEST(Cuckoo_striped_list)
- CPPUNIT_TEST(Cuckoo_striped_vector)
- CPPUNIT_TEST(Cuckoo_refinable_list)
- CPPUNIT_TEST(Cuckoo_refinable_vector)
- CPPUNIT_TEST_SUITE_END()
-
- };
-} // namespace map
-
-#endif // #ifndef CDSTEST_HDR_CUCKOO_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_FELDMAN_HASHMAP_H
-#define CDSTEST_HDR_FELDMAN_HASHMAP_H
-
-#include "cppunit/cppunit_proxy.h"
-
-// forward declaration
-namespace cds {
- namespace container {}
- namespace opt {}
-}
-
-namespace map {
- namespace cc = cds::container;
- namespace co = cds::opt;
-
- class FeldmanHashMapHdrTest : public CppUnitMini::TestCase
- {
- struct Item
- {
- unsigned int nInsertCall;
- unsigned int nFindCall;
- unsigned int nEraseCall;
- mutable unsigned int nIteratorCall;
-
- Item()
- : nInsertCall(0)
- , nFindCall(0)
- , nEraseCall(0)
- , nIteratorCall(0)
- {}
-
- explicit Item( unsigned int n )
- : nInsertCall(n)
- , nFindCall(0)
- , nEraseCall(0)
- , nIteratorCall(0)
- {}
- };
-
- struct hash128
- {
- size_t lo;
- size_t hi;
-
- hash128() {}
- hash128(size_t l, size_t h) : lo(l), hi(h) {}
- hash128( hash128 const& h) : lo(h.lo), hi(h.hi) {}
-
- struct make {
- hash128 operator()( size_t n ) const
- {
- return hash128( std::hash<size_t>()( n ), std::hash<size_t>()( ~n ));
- }
- hash128 operator()( hash128 const& n ) const
- {
- return hash128( std::hash<size_t>()( n.lo ), std::hash<size_t>()( ~n.hi ));
- }
- };
-
- struct less {
- bool operator()( hash128 const& lhs, hash128 const& rhs ) const
- {
- if ( lhs.hi != rhs.hi )
- return lhs.hi < rhs.hi;
- return lhs.lo < rhs.lo;
- }
- };
-
- struct cmp {
- int operator()( hash128 const& lhs, hash128 const& rhs ) const
- {
- if ( lhs.hi != rhs.hi )
- return lhs.hi < rhs.hi ? -1 : 1;
- return lhs.lo < rhs.lo ? -1 : lhs.lo == rhs.lo ? 0 : 1;
- }
- };
-
- friend bool operator==( hash128 const& lhs, hash128 const& rhs )
- {
- return cmp()( lhs, rhs ) == 0;
- }
- friend bool operator!=(hash128 const& lhs, hash128 const& rhs)
- {
- return !( lhs == rhs );
- }
- };
-
- template <typename Map>
- void test_hp( size_t nHeadBits, size_t nArrayBits )
- {
- typedef typename Map::hash_type hash_type;
- typedef typename Map::key_type key_type;
- typedef typename Map::mapped_type mapped_type;
- typedef typename Map::value_type value_type;
- typedef typename Map::guarded_ptr guarded_ptr;
-
- size_t const capacity = 1000;
-
- Map m( nHeadBits, nArrayBits );
- CPPUNIT_MSG("Array size: head=" << m.head_size() << ", array_node=" << m.array_node_size());
- //CPPUNIT_ASSERT(m.head_size() >= (size_t(1) << nHeadBits));
- //CPPUNIT_ASSERT(m.array_node_size() == (size_t(1) << nArrayBits));
-
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // insert( key )/update()/get()/find()
- for ( size_t i = 0; i < capacity; ++i ) {
- size_t key = i * 57;
- CPPUNIT_ASSERT(!m.contains( key ))
- CPPUNIT_ASSERT(m.insert( key ));
- CPPUNIT_ASSERT(m.contains( key ));
- CPPUNIT_ASSERT(m.size() == i + 1);
-
- auto ret = m.update(key, [] ( value_type& v, value_type * old ) {
- CPPUNIT_ASSERT_CURRENT( old != nullptr );
- ++v.second.nInsertCall;
- }, false );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( !ret.second );
-
- CPPUNIT_ASSERT(m.find(key, [](value_type& v) { ++v.second.nFindCall;} ));
-
- guarded_ptr gp{ m.get( key ) };
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( gp->first == key );
- CPPUNIT_ASSERT( gp->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( gp->second.nFindCall == 1 );
- }
- CPPUNIT_ASSERT(!m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // iterator test
- size_t nCount = 0;
- for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->second.nIteratorCall == 0 );
- CPPUNIT_ASSERT( it->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( (*it).second.nFindCall == 1 );
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- nCount = 0;
- for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( (*it).second.nFindCall == 1 );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 1 );
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- nCount = 0;
- for ( auto it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( (*it).second.nFindCall == 1 );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 2 );
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- nCount = 0;
- for ( auto it = m.crbegin(), itEnd = m.crend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( (*it).second.nFindCall == 1 );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 3 );
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- // find
- for ( size_t i = 0; i < capacity; i++ ) {
- size_t key = i * 57;
- CPPUNIT_ASSERT( m.find( key, [key]( value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == key );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == 1 );
- CPPUNIT_ASSERT_CURRENT( v.second.nFindCall == 1 );
- CPPUNIT_ASSERT_CURRENT( v.second.nIteratorCall == 4 );
- }));
- }
-
- // erase
- for ( size_t i = capacity; i > 0; --i ) {
- size_t key = (i -1) * 57;
- guarded_ptr gp = m.get( key );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( gp->first == key );
- CPPUNIT_ASSERT( gp->second.nInsertCall == 1 );
- CPPUNIT_ASSERT( gp->second.nFindCall == 1 );
- CPPUNIT_ASSERT( (*gp).second.nIteratorCall == 4 );
-
- CPPUNIT_ASSERT(m.erase( key ));
-
- gp = m.get( key );
- CPPUNIT_ASSERT( !gp );
- CPPUNIT_ASSERT(!m.contains( key ));
- }
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // Iterators on empty map
- CPPUNIT_ASSERT(m.begin() == m.end());
- CPPUNIT_ASSERT(m.cbegin() == m.cend());
- CPPUNIT_ASSERT(m.rbegin() == m.rend());
- CPPUNIT_ASSERT(m.crbegin() == m.crend());
-
- // insert( key, val )
- for ( size_t i = 0; i < capacity; ++i ) {
- CPPUNIT_ASSERT(!m.contains(i));
- CPPUNIT_ASSERT(m.insert( i, (unsigned int) i * 100));
- CPPUNIT_ASSERT( m.contains(i));
- CPPUNIT_ASSERT( m.find( i, [i]( value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == i );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i * 100 );
- }));
- }
- CPPUNIT_ASSERT( !m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // erase( key, func )
- for ( size_t i = 0; i < capacity; ++i ) {
- CPPUNIT_ASSERT( m.contains(i));
- CPPUNIT_ASSERT( m.erase( i, [i]( value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == i );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i * 100 );
- v.second.nInsertCall = 0;
- }));
- }
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0 );
-
- // insert_with
- for ( size_t i = 0; i < capacity; ++i ) {
- size_t key = i * 121;
- CPPUNIT_ASSERT(!m.contains(key));
- CPPUNIT_ASSERT( m.insert_with( key, [key]( value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == key );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == 0 );
- v.second.nInsertCall = decltype(v.second.nInsertCall)( key );
- }));
- CPPUNIT_ASSERT(m.find(key, [key] (value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == key );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == key );
- }));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT( !m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- nCount = 0;
- for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.nInsertCall );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 0 );
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- nCount = 0;
- for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.nInsertCall );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 1 );
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == capacity );
-
- // erase_at( iterator )
- nCount = 0;
- for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.nInsertCall );
- CPPUNIT_ASSERT( it->second.nIteratorCall == 2 );
- CPPUNIT_ASSERT(m.erase_at( it ));
- ++nCount;
- CPPUNIT_ASSERT(!m.contains( it->first ));
- }
- CPPUNIT_ASSERT( nCount == capacity );
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0 );
-
- // emplace
- for ( size_t i = 0; i < capacity; ++i ) {
- size_t key = i * 1023;
- CPPUNIT_ASSERT(!m.contains(key));
- CPPUNIT_ASSERT( m.emplace( key, (unsigned int) i ));
- CPPUNIT_ASSERT(m.find(key, [key] (value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == key );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall * 1023 == key );
- }));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT( !m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // erase_at( reverse_iterator )
- nCount = 0;
- for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.nInsertCall * 1023 );
- CPPUNIT_ASSERT(m.erase_at( it ));
- ++nCount;
- CPPUNIT_ASSERT(!m.contains( it->first ));
- }
- CPPUNIT_ASSERT( nCount == capacity );
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0 );
-
-
- // extract
- for ( size_t i = 0; i < capacity; ++i ) {
- size_t key = i * 711;
- CPPUNIT_ASSERT(!m.contains(key));
- auto ret = m.update( key, [i]( value_type& v, value_type * old ) {
- CPPUNIT_ASSERT_CURRENT( old == nullptr );
- v.second.nInsertCall = (unsigned int) i;
- });
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT(m.find(key, [i, key] (value_type& v ) {
- CPPUNIT_ASSERT_CURRENT( v.first == key );
- CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i );
- }));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT( !m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- for ( size_t i = capacity; i > 0; --i ) {
- size_t key = (i-1) * 711;
- guarded_ptr gp{ m.extract(key) };
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( gp->first == key );
- CPPUNIT_ASSERT((*gp).second.nInsertCall == i - 1 );
- gp = m.extract(key);
- CPPUNIT_ASSERT( !gp );
- }
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0 );
-
- // clear
- for ( size_t i = 0; i < capacity; ++i ) {
- CPPUNIT_ASSERT(!m.contains( i ))
- CPPUNIT_ASSERT(m.insert( i ));
- CPPUNIT_ASSERT(m.contains( i ));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT( !m.empty());
- CPPUNIT_ASSERT(m.size() == capacity );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty());
- CPPUNIT_ASSERT(m.size() == 0 );
-
-
- CPPUNIT_MSG( m.statistics() );
- }
-
- template <typename Map>
- void test_rcu(size_t nHeadBits, size_t nArrayBits)
- {
- typedef typename Map::hash_type hash_type;
- typedef typename Map::key_type key_type;
- typedef typename Map::mapped_type mapped_type;
- typedef typename Map::value_type value_type;
- typedef typename Map::exempt_ptr exempt_ptr;
- typedef typename Map::rcu_lock rcu_lock;
-
- size_t const capacity = 1000;
-
- Map m(nHeadBits, nArrayBits);
- CPPUNIT_MSG("Array size: head=" << m.head_size() << ", array_node=" << m.array_node_size());
- CPPUNIT_ASSERT(m.head_size() >= (size_t(1) << nHeadBits));
- CPPUNIT_ASSERT(m.array_node_size() == (size_t(1) << nArrayBits));
-
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // insert( key )/update()/get()/find()
- for (size_t i = 0; i < capacity; ++i) {
- size_t key = i * 57;
- CPPUNIT_ASSERT(!m.contains(key))
- CPPUNIT_ASSERT(m.insert(key));
- CPPUNIT_ASSERT(m.contains(key));
- CPPUNIT_ASSERT(m.size() == i + 1);
-
- auto ret = m.update(key, [](value_type& v, value_type * old) {
- CPPUNIT_ASSERT_CURRENT(old != nullptr);
- ++v.second.nInsertCall;
- }, false);
- CPPUNIT_ASSERT(ret.first);
- CPPUNIT_ASSERT(!ret.second);
-
- CPPUNIT_ASSERT(m.find(key, [](value_type& v) { ++v.second.nFindCall;}));
-
- {
- rcu_lock l;
- value_type* p{ m.get(key) };
- CPPUNIT_ASSERT(p);
- CPPUNIT_ASSERT(p->first == key);
- CPPUNIT_ASSERT(p->second.nInsertCall == 1);
- CPPUNIT_ASSERT(p->second.nFindCall == 1);
- }
- }
- CPPUNIT_ASSERT(!m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // iterator test
- size_t nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->second.nIteratorCall == 0);
- CPPUNIT_ASSERT(it->second.nInsertCall == 1);
- CPPUNIT_ASSERT((*it).second.nFindCall == 1);
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->second.nInsertCall == 1);
- CPPUNIT_ASSERT((*it).second.nFindCall == 1);
- CPPUNIT_ASSERT(it->second.nIteratorCall == 1);
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->second.nInsertCall == 1);
- CPPUNIT_ASSERT((*it).second.nFindCall == 1);
- CPPUNIT_ASSERT(it->second.nIteratorCall == 2);
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.crbegin(), itEnd = m.crend(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->second.nInsertCall == 1);
- CPPUNIT_ASSERT((*it).second.nFindCall == 1);
- CPPUNIT_ASSERT(it->second.nIteratorCall == 3);
- (*it).second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- // find
- for (size_t i = 0; i < capacity; i++) {
- size_t key = i * 57;
- CPPUNIT_ASSERT(m.find(key, [key](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == key);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == 1);
- CPPUNIT_ASSERT_CURRENT(v.second.nFindCall == 1);
- CPPUNIT_ASSERT_CURRENT(v.second.nIteratorCall == 4);
- }));
- }
-
- // erase
- for (size_t i = capacity; i > 0; --i) {
- size_t key = (i - 1) * 57;
- {
- rcu_lock l;
- value_type* p = m.get(key);
- CPPUNIT_ASSERT(p);
- CPPUNIT_ASSERT(p->first == key);
- CPPUNIT_ASSERT(p->second.nInsertCall == 1);
- CPPUNIT_ASSERT(p->second.nFindCall == 1);
- CPPUNIT_ASSERT(p->second.nIteratorCall == 4);
- }
-
- CPPUNIT_ASSERT(m.erase(key));
-
- {
- rcu_lock l;
- value_type* p = m.get(key);
- CPPUNIT_ASSERT(!p);
- }
- CPPUNIT_ASSERT(!m.contains(key));
- }
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // Iterators on empty map
- {
- rcu_lock l;
- CPPUNIT_ASSERT(m.begin() == m.end());
- CPPUNIT_ASSERT(m.cbegin() == m.cend());
- CPPUNIT_ASSERT(m.rbegin() == m.rend());
- CPPUNIT_ASSERT(m.crbegin() == m.crend());
- }
-
- // insert( key, val )
- for (size_t i = 0; i < capacity; ++i) {
- CPPUNIT_ASSERT(!m.contains(i));
- CPPUNIT_ASSERT(m.insert(i, (unsigned int)i * 100));
- CPPUNIT_ASSERT(m.contains(i));
- CPPUNIT_ASSERT(m.find(i, [i](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == i);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == i * 100);
- }));
- }
- CPPUNIT_ASSERT(!m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // erase( key, func )
- for (size_t i = 0; i < capacity; ++i) {
- CPPUNIT_ASSERT(m.contains(i));
- CPPUNIT_ASSERT(m.erase(i, [i](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == i);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == i * 100);
- v.second.nInsertCall = 0;
- }));
- }
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // insert_with
- for (size_t i = 0; i < capacity; ++i) {
- size_t key = i * 121;
- CPPUNIT_ASSERT(!m.contains(key));
- CPPUNIT_ASSERT(m.insert_with(key, [key](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == key);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == 0);
- v.second.nInsertCall = decltype(v.second.nInsertCall)(key);
- }));
- CPPUNIT_ASSERT(m.find(key, [key](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == key);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == key);
- }));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT(!m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->first == it->second.nInsertCall);
- CPPUNIT_ASSERT(it->second.nIteratorCall == 0);
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- nCount = 0;
- {
- rcu_lock l;
- for (auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it) {
- CPPUNIT_ASSERT(it->first == it->second.nInsertCall);
- CPPUNIT_ASSERT(it->second.nIteratorCall == 1);
- it->second.nIteratorCall += 1;
- ++nCount;
- }
- }
- CPPUNIT_ASSERT(nCount == capacity);
-
- // clear()
- m.clear();
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- // emplace
- for (size_t i = 0; i < capacity; ++i) {
- size_t key = i * 1023;
- CPPUNIT_ASSERT(!m.contains(key));
- CPPUNIT_ASSERT(m.emplace(key, static_cast<unsigned int>(i)));
- CPPUNIT_ASSERT(m.find(key, [key](value_type& v) {
- CPPUNIT_ASSERT_CURRENT(v.first == key);
- CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall * 1023 == key);
- }));
- CPPUNIT_ASSERT(m.size() == i + 1);
- }
- CPPUNIT_ASSERT(!m.empty());
- CPPUNIT_ASSERT(m.size() == capacity);
-
- // extract
- for (size_t i = capacity; i > 0; --i) {
- size_t key = (i - 1) * 1023;
- exempt_ptr xp{ m.extract(key) };
- CPPUNIT_ASSERT(xp);
- CPPUNIT_ASSERT(xp->first == key);
- CPPUNIT_ASSERT((*xp).second.nInsertCall == static_cast<unsigned int>(i - 1));
- xp = m.extract(key);
- CPPUNIT_ASSERT(!xp);
- }
- CPPUNIT_ASSERT(m.empty());
- CPPUNIT_ASSERT(m.size() == 0);
-
- CPPUNIT_MSG(m.statistics());
- }
-
- void hp_nohash();
- void hp_nohash_stat();
- void hp_nohash_5_3();
- void hp_nohash_5_3_stat();
- void hp_stdhash();
- void hp_stdhash_stat();
- void hp_stdhash_5_3();
- void hp_stdhash_5_3_stat();
- void hp_hash128();
- void hp_hash128_stat();
- void hp_hash128_4_3();
- void hp_hash128_4_3_stat();
-
- void dhp_nohash();
- void dhp_nohash_stat();
- void dhp_nohash_5_3();
- void dhp_nohash_5_3_stat();
- void dhp_stdhash();
- void dhp_stdhash_stat();
- void dhp_stdhash_5_3();
- void dhp_stdhash_5_3_stat();
- void dhp_hash128();
- void dhp_hash128_stat();
- void dhp_hash128_4_3();
- void dhp_hash128_4_3_stat();
-
- void rcu_gpb_nohash();
- void rcu_gpb_nohash_stat();
- void rcu_gpb_nohash_5_3();
- void rcu_gpb_nohash_5_3_stat();
- void rcu_gpb_stdhash();
- void rcu_gpb_stdhash_stat();
- void rcu_gpb_stdhash_5_3();
- void rcu_gpb_stdhash_5_3_stat();
- void rcu_gpb_hash128();
- void rcu_gpb_hash128_stat();
- void rcu_gpb_hash128_4_3();
- void rcu_gpb_hash128_4_3_stat();
-
- void rcu_gpi_nohash();
- void rcu_gpi_nohash_stat();
- void rcu_gpi_nohash_5_3();
- void rcu_gpi_nohash_5_3_stat();
- void rcu_gpi_stdhash();
- void rcu_gpi_stdhash_stat();
- void rcu_gpi_stdhash_5_3();
- void rcu_gpi_stdhash_5_3_stat();
- void rcu_gpi_hash128();
- void rcu_gpi_hash128_stat();
- void rcu_gpi_hash128_4_3();
- void rcu_gpi_hash128_4_3_stat();
-
- void rcu_gpt_nohash();
- void rcu_gpt_nohash_stat();
- void rcu_gpt_nohash_5_3();
- void rcu_gpt_nohash_5_3_stat();
- void rcu_gpt_stdhash();
- void rcu_gpt_stdhash_stat();
- void rcu_gpt_stdhash_5_3();
- void rcu_gpt_stdhash_5_3_stat();
- void rcu_gpt_hash128();
- void rcu_gpt_hash128_stat();
- void rcu_gpt_hash128_4_3();
- void rcu_gpt_hash128_4_3_stat();
-
- void rcu_shb_nohash();
- void rcu_shb_nohash_stat();
- void rcu_shb_nohash_5_3();
- void rcu_shb_nohash_5_3_stat();
- void rcu_shb_stdhash();
- void rcu_shb_stdhash_stat();
- void rcu_shb_stdhash_5_3();
- void rcu_shb_stdhash_5_3_stat();
- void rcu_shb_hash128();
- void rcu_shb_hash128_stat();
- void rcu_shb_hash128_4_3();
- void rcu_shb_hash128_4_3_stat();
-
- void rcu_sht_nohash();
- void rcu_sht_nohash_stat();
- void rcu_sht_nohash_5_3();
- void rcu_sht_nohash_5_3_stat();
- void rcu_sht_stdhash();
- void rcu_sht_stdhash_stat();
- void rcu_sht_stdhash_5_3();
- void rcu_sht_stdhash_5_3_stat();
- void rcu_sht_hash128();
- void rcu_sht_hash128_stat();
- void rcu_sht_hash128_4_3();
- void rcu_sht_hash128_4_3_stat();
-
- CPPUNIT_TEST_SUITE(FeldmanHashMapHdrTest)
- CPPUNIT_TEST(hp_nohash)
- CPPUNIT_TEST(hp_nohash_stat)
- CPPUNIT_TEST(hp_nohash_5_3)
- CPPUNIT_TEST(hp_nohash_5_3_stat)
- CPPUNIT_TEST(hp_stdhash)
- CPPUNIT_TEST(hp_stdhash_stat)
- CPPUNIT_TEST(hp_stdhash_5_3)
- CPPUNIT_TEST(hp_stdhash_5_3_stat)
- CPPUNIT_TEST(hp_hash128)
- CPPUNIT_TEST(hp_hash128_stat)
- CPPUNIT_TEST(hp_hash128_4_3)
- CPPUNIT_TEST(hp_hash128_4_3_stat)
-
- CPPUNIT_TEST(dhp_nohash)
- CPPUNIT_TEST(dhp_nohash_stat)
- CPPUNIT_TEST(dhp_nohash_5_3)
- CPPUNIT_TEST(dhp_nohash_5_3_stat)
- CPPUNIT_TEST(dhp_stdhash)
- CPPUNIT_TEST(dhp_stdhash_stat)
- CPPUNIT_TEST(dhp_stdhash_5_3)
- CPPUNIT_TEST(dhp_stdhash_5_3_stat)
- CPPUNIT_TEST(dhp_hash128)
- CPPUNIT_TEST(dhp_hash128_stat)
- CPPUNIT_TEST(dhp_hash128_4_3)
- CPPUNIT_TEST(dhp_hash128_4_3_stat)
-
- CPPUNIT_TEST(rcu_gpb_nohash)
- CPPUNIT_TEST(rcu_gpb_nohash_stat)
- CPPUNIT_TEST(rcu_gpb_nohash_5_3)
- CPPUNIT_TEST(rcu_gpb_nohash_5_3_stat)
- CPPUNIT_TEST(rcu_gpb_stdhash)
- CPPUNIT_TEST(rcu_gpb_stdhash_stat)
- CPPUNIT_TEST(rcu_gpb_stdhash_5_3)
- CPPUNIT_TEST(rcu_gpb_stdhash_5_3_stat)
- CPPUNIT_TEST(rcu_gpb_hash128)
- CPPUNIT_TEST(rcu_gpb_hash128_stat)
- CPPUNIT_TEST(rcu_gpb_hash128_4_3)
- CPPUNIT_TEST(rcu_gpb_hash128_4_3_stat)
-
- CPPUNIT_TEST(rcu_gpi_nohash)
- CPPUNIT_TEST(rcu_gpi_nohash_stat)
- CPPUNIT_TEST(rcu_gpi_nohash_5_3)
- CPPUNIT_TEST(rcu_gpi_nohash_5_3_stat)
- CPPUNIT_TEST(rcu_gpi_stdhash)
- CPPUNIT_TEST(rcu_gpi_stdhash_stat)
- CPPUNIT_TEST(rcu_gpi_stdhash_5_3)
- CPPUNIT_TEST(rcu_gpi_stdhash_5_3_stat)
- CPPUNIT_TEST(rcu_gpi_hash128)
- CPPUNIT_TEST(rcu_gpi_hash128_stat)
- CPPUNIT_TEST(rcu_gpi_hash128_4_3)
- CPPUNIT_TEST(rcu_gpi_hash128_4_3_stat)
-
- CPPUNIT_TEST(rcu_gpt_nohash)
- CPPUNIT_TEST(rcu_gpt_nohash_stat)
- CPPUNIT_TEST(rcu_gpt_nohash_5_3)
- CPPUNIT_TEST(rcu_gpt_nohash_5_3_stat)
- CPPUNIT_TEST(rcu_gpt_stdhash)
- CPPUNIT_TEST(rcu_gpt_stdhash_stat)
- CPPUNIT_TEST(rcu_gpt_stdhash_5_3)
- CPPUNIT_TEST(rcu_gpt_stdhash_5_3_stat)
- CPPUNIT_TEST(rcu_gpt_hash128)
- CPPUNIT_TEST(rcu_gpt_hash128_stat)
- CPPUNIT_TEST(rcu_gpt_hash128_4_3)
- CPPUNIT_TEST(rcu_gpt_hash128_4_3_stat)
-
- CPPUNIT_TEST(rcu_shb_nohash)
- CPPUNIT_TEST(rcu_shb_nohash_stat)
- CPPUNIT_TEST(rcu_shb_nohash_5_3)
- CPPUNIT_TEST(rcu_shb_nohash_5_3_stat)
- CPPUNIT_TEST(rcu_shb_stdhash)
- CPPUNIT_TEST(rcu_shb_stdhash_stat)
- CPPUNIT_TEST(rcu_shb_stdhash_5_3)
- CPPUNIT_TEST(rcu_shb_stdhash_5_3_stat)
- CPPUNIT_TEST(rcu_shb_hash128)
- CPPUNIT_TEST(rcu_shb_hash128_stat)
- CPPUNIT_TEST(rcu_shb_hash128_4_3)
- CPPUNIT_TEST(rcu_shb_hash128_4_3_stat)
-
- CPPUNIT_TEST(rcu_sht_nohash)
- CPPUNIT_TEST(rcu_sht_nohash_stat)
- CPPUNIT_TEST(rcu_sht_nohash_5_3)
- CPPUNIT_TEST(rcu_sht_nohash_5_3_stat)
- CPPUNIT_TEST(rcu_sht_stdhash)
- CPPUNIT_TEST(rcu_sht_stdhash_stat)
- CPPUNIT_TEST(rcu_sht_stdhash_5_3)
- CPPUNIT_TEST(rcu_sht_stdhash_5_3_stat)
- CPPUNIT_TEST(rcu_sht_hash128)
- CPPUNIT_TEST(rcu_sht_hash128_stat)
- CPPUNIT_TEST(rcu_sht_hash128_4_3)
- CPPUNIT_TEST(rcu_sht_hash128_4_3_stat)
- CPPUNIT_TEST_SUITE_END()
-
- };
-
-} // namespace map
-
-#endif //#ifndef CDSTEST_HDR_FELDMAN_HASHMAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/container/feldman_hashmap_dhp.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
- namespace {
- typedef cds::gc::DHP gc_type;
- } // namespace
-
- void FeldmanHashMapHdrTest::dhp_nohash()
- {
- typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
-
- test_hp<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_stdhash()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
-
- test_hp<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_hash128()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_nohash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_stdhash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_hash128_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::dhp_nohash_5_3()
- {
- typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
-
- test_hp<map_type>(5, 3);
- }
-
-
- void FeldmanHashMapHdrTest::dhp_stdhash_5_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
-
- test_hp<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::dhp_nohash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_hp<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::dhp_stdhash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_hp<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::dhp_hash128_4_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 3);
- }
-
- void FeldmanHashMapHdrTest::dhp_hash128_4_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 3);
- }
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::FeldmanHashMapHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/container/feldman_hashmap_hp.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
- namespace {
- typedef cds::gc::HP gc_type;
- } // namespace
-
- void FeldmanHashMapHdrTest::hp_nohash()
- {
- typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
-
- test_hp<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_stdhash()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
-
- test_hp<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_hash128()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_nohash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_stdhash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_hash128_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::hp_nohash_5_3()
- {
- typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
-
- test_hp<map_type>(5, 3);
- }
-
-
- void FeldmanHashMapHdrTest::hp_stdhash_5_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
-
- test_hp<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::hp_nohash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_hp<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::hp_stdhash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_hp<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::hp_hash128_4_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 3);
- }
-
- void FeldmanHashMapHdrTest::hp_hash128_4_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
- test_hp<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< gc_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_hp<map_type2>(4, 3);
- }
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::FeldmanHashMapHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/feldman_hashmap_rcu.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<>> rcu_type;
- } // namespace
-
- void FeldmanHashMapHdrTest::rcu_gpb_nohash()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_stdhash()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_hash128()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_nohash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_stdhash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash<std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_hash128_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/feldman_hashmap_rcu.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<>> rcu_type;
- } // namespace
-
- void FeldmanHashMapHdrTest::rcu_gpi_nohash()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_stdhash()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_hash128()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_nohash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_stdhash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash<std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_hash128_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_nohash_5_3()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_stdhash_5_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_nohash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_stdhash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_hash128_4_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpi_hash128_4_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/feldman_hashmap_rcu.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<>> rcu_type;
- } // namespace
-
- void FeldmanHashMapHdrTest::rcu_gpt_nohash()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_stdhash()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_hash128()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_nohash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_stdhash_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash<std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_hash128_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_nohash_5_3()
- {
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_stdhash_5_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_nohash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_stdhash_5_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_hash128_4_3()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
- void FeldmanHashMapHdrTest::rcu_gpt_hash128_4_3_stat()
- {
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/feldman_hashmap_rcu.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<>> rcu_type;
- } // namespace
-#endif
-
- void FeldmanHashMapHdrTest::rcu_shb_nohash()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_stdhash()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_hash128()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_nohash_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_stdhash_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash<std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_hash128_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_nohash_5_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_stdhash_5_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_nohash_5_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_stdhash_5_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_hash128_4_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_shb_hash128_4_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_feldman_hashmap.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/feldman_hashmap_rcu.h>
-#include "unit/print_feldman_hashset_stat.h"
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<>> rcu_type;
- } // namespace
-#endif
-
- void FeldmanHashMapHdrTest::rcu_sht_nohash()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_stdhash()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_hash128()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_nohash_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_stdhash_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- typedef cc::feldman_hashmap::stat<> stat;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::hash<std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_hash128_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef hash128::make hash;
- typedef hash128::cmp compare;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 2);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::hash< hash128::make >
- , co::compare< hash128::cmp >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 2);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
-
- test_rcu<map_type>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
-
- test_rcu<map_type>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- , co::back_off< cds::backoff::empty >
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef cc::feldman_hashmap::stat<> stat;
- typedef cds::backoff::empty back_off;
- typedef std::hash<size_t> hash;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(5, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::stat< cc::feldman_hashmap::stat<>>
- ,co::back_off< cds::backoff::empty >
- ,co::hash< std::hash<size_t>>
- >::type
- > map_type2;
- test_rcu<map_type2>(5, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
-#endif
- }
-
- void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits : public cc::feldman_hashmap::traits {
- typedef hash128::make hash;
- typedef hash128::less less;
- typedef cc::feldman_hashmap::stat<> stat;
- typedef co::v::sequential_consistent memory_model;
- };
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
- test_rcu<map_type>(4, 3);
-
- typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
- typename cc::feldman_hashmap::make_traits<
- co::hash< hash128::make >
- , co::less< hash128::less >
- , co::stat< cc::feldman_hashmap::stat<>>
- , co::memory_model< co::v::sequential_consistent >
- >::type
- > map_type2;
- test_rcu<map_type2>(4, 3);
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_MAP_H
-#define CDSTEST_HDR_MAP_H
-#include "size_check.h"
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/os/timer.h>
-#include <cds/opt/hash.h>
-#include <functional> // ref
-
-namespace cds { namespace container {}}
-
-namespace map {
- using misc::check_size;
-
- namespace cc = cds::container;
- namespace co = cds::opt;
-
- // MichaelHashSet based on MichaelList
- class HashMapHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct value_type {
- int m_val;
-
- value_type()
- : m_val(0)
- {}
-
- value_type( int n )
- : m_val( n )
- {}
-
- value_type( value_type&& v )
- : m_val( v.m_val )
- {}
-
- value_type( value_type const& v )
- : m_val( v.m_val )
- {}
-
- value_type& operator=( value_type const& v )
- {
- m_val = v.m_val;
- return *this;
- }
- };
-
- typedef std::pair<key_type const, value_type> pair_type;
-
- struct less
- {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 < v2;
- }
- };
-
- struct cmp {
- int operator ()(int v1, int v2 ) const
- {
- if ( v1 < v2 )
- return -1;
- return v1 > v2 ? 1 : 0;
- }
- };
-
- struct equal {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 == v2;
- }
- };
-
- struct hash_int {
- size_t operator()( int i ) const
- {
- return co::v::hash<int>()( i );
- }
-
- template <typename T>
- size_t operator()( T const& i ) const
- {
- return co::v::hash<int>()( i.nKey );
- }
- };
-
- struct simple_item_counter {
- size_t m_nCount;
-
- simple_item_counter()
- : m_nCount(0)
- {}
-
- size_t operator ++()
- {
- return ++m_nCount;
- }
-
- size_t operator --()
- {
- return --m_nCount;
- }
-
- void reset()
- {
- m_nCount = 0;
- }
-
- operator size_t() const
- {
- return m_nCount;
- }
- };
-
- template <typename Map>
- struct insert_functor
- {
- typedef typename Map::value_type pair_type;
-
- // insert ftor
- void operator()( pair_type& item )
- {
- item.second.m_val = item.first * 3;
- }
-
- // update ftor
- void operator()( bool bNew, pair_type& item )
- {
- if ( bNew )
- item.second.m_val = item.first * 2;
- else
- item.second.m_val = item.first * 5;
- }
- };
-
- struct check_value {
- int m_nExpected;
-
- check_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- template <typename T>
- void operator ()( T& pair )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- template <typename T, typename Q>
- void operator ()( T& pair, Q )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- };
-
- struct extract_functor
- {
- int * m_pVal;
- void operator()( pair_type const& val )
- {
- *m_pVal = val.second.m_val;
- }
- };
-
- struct other_item {
- int nKey;
-
- other_item( int key )
- : nKey(key)
- {}
- };
-
- struct other_less
- {
- bool operator ()(int v1, other_item const& v2 ) const
- {
- return v1 < v2.nKey;
- }
- bool operator ()(other_item const& v1, int v2 ) const
- {
- return v1.nKey < v2;
- }
- };
-
-
- template <class Map>
- void test_int()
- {
- Map m( 100, 4 );
-
- test_int_with(m);
-
- // extract/get test
- CPPUNIT_ASSERT( m.empty() );
- {
- const int nLimit = 100;
- typename Map::guarded_ptr gp;
- int arrRandom[nLimit];
- for ( int i = 0; i < nLimit; ++i )
- arrRandom[i] = i;
- shuffle( arrRandom, arrRandom + nLimit );
-
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
-
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrRandom[i];
- gp = m.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- gp.release();
-
- gp = m.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- gp.release();
-
- gp = m.get( nKey );
- CPPUNIT_CHECK( !gp );
-
- CPPUNIT_CHECK( !m.extract(nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( m.empty() );
-
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
-
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrRandom[i];
- gp = m.get_with( other_item( nKey ), other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- gp.release();
-
- gp = m.extract_with( other_item( nKey ), other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- gp.release();
-
- gp = m.get_with( other_item( nKey ), other_less() );
- CPPUNIT_CHECK( !gp );
-
- CPPUNIT_CHECK( !m.extract_with(other_item(nKey), other_less() ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( m.empty() );
- }
-
- // iterator test
- test_iter<Map>();
- }
-
- template <class Map>
- void test_rcu()
- {
- Map m( 52, 4 );
-
- test_int_with(m);
-
- // extract/get test
- {
- typedef typename Map::gc rcu;
- typedef typename Map::rcu_lock rcu_lock;
- typedef typename Map::value_type value_type;
- typename Map::exempt_ptr ep;
-
- static size_t const nLimit = 100;
- int arr[nLimit];
- for ( size_t i = 0; i < nLimit; ++i )
- arr[i] = (int) i;
- shuffle( arr, arr + nLimit );
-
- for ( size_t i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
-
- for ( size_t i = 0; i < nLimit; i += 2 ) {
- value_type * pVal;
- int nKey = arr[i];
- {
- rcu_lock l;
- pVal = m.get( nKey );
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == nKey );
- CPPUNIT_CHECK( pVal->second.m_val == nKey );
-
- ep = m.extract( nKey );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( pVal->first == ep->first );
- CPPUNIT_CHECK( pVal->second.m_val == ep->second.m_val );
- }
- ep.release();
- {
- rcu_lock l;
- CPPUNIT_CHECK( m.get( nKey ) == nullptr );
- ep = m.extract( nKey );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
-
- nKey = arr[i+1];
- pVal = m.get_with( other_item(nKey), other_less() );
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == nKey );
- CPPUNIT_CHECK( pVal->second.m_val == nKey );
-
- ep = m.extract_with( other_item( nKey ), other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( pVal->first == ep->first );
- CPPUNIT_CHECK( pVal->second.m_val == (*ep).second.m_val );
- }
- ep.release();
- {
- rcu_lock l;
- CPPUNIT_CHECK( m.get_with( other_item(nKey), other_less() ) == nullptr );
- CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_CHECK( m.empty() );
- CPPUNIT_CHECK( check_size( m, 0 ));
- {
- rcu_lock l;
- CPPUNIT_CHECK( m.get( int(nLimit / 2) ) == nullptr );
- ep = m.extract( int( nLimit / 2 ) );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
-
- // iterator test
- test_iter<Map>();
- }
-
- template <class Map>
- void test_rcu_michael_list()
- {
- Map m( 52, 4 );
-
- test_int_with(m);
-
- // extract/get test
- {
- typedef typename Map::gc rcu;
- typedef typename Map::rcu_lock rcu_lock;
- typedef typename Map::value_type value_type;
- typename Map::exempt_ptr ep;
- typename Map::raw_ptr gp;
-
- static size_t const nLimit = 100;
- int arr[nLimit];
- for ( size_t i = 0; i < nLimit; ++i )
- arr[i] = (int) i;
- shuffle( arr, arr + nLimit );
-
- for ( size_t i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
-
- for ( size_t i = 0; i < nLimit; i += 2 ) {
- int nKey = arr[i];
- {
- rcu_lock l;
- gp = m.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- }
- gp.release();
-
- ep = m.extract( nKey );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( nKey == ep->first );
- CPPUNIT_CHECK( nKey == ep->second.m_val );
- ep.release();
-
- {
- rcu_lock l;
- CPPUNIT_CHECK( !m.get( nKey ));
- }
- ep = m.extract( nKey );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
-
- {
- rcu_lock l;
- nKey = arr[i+1];
- gp = m.get_with( other_item(nKey), other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey );
- }
- gp.release();
-
- ep = m.extract_with( other_item( nKey ), other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( nKey == ep->first );
- CPPUNIT_CHECK( nKey == (*ep).second.m_val );
- ep.release();
-
- {
- rcu_lock l;
- CPPUNIT_CHECK( !m.get_with( other_item(nKey), other_less() ));
- }
- CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- CPPUNIT_CHECK( m.empty() );
- CPPUNIT_CHECK( check_size( m, 0 ));
- {
- rcu_lock l;
- CPPUNIT_CHECK( !m.get( int(nLimit / 2) ));
- }
- ep = m.extract( int( nLimit / 2 ) );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
-
- // iterator test
- test_iter<Map>();
- }
-
- template <class Map>
- void test_rcu_split_list()
- {
- test_rcu_michael_list<Map>();
- }
-
- template <class Map>
- void test_int_with( Map& m )
- {
- std::pair<bool, bool> updateResult;
-
- // insert
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(25) );
-
- CPPUNIT_ASSERT( !m.insert( 25 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
-
- CPPUNIT_ASSERT( !m.contains(10, less()) );
- CPPUNIT_ASSERT( m.insert( 10, 10 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(10, less()) );
-
- CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
-
- CPPUNIT_ASSERT( !m.contains(30) );
- CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(30) );
-
- CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
-
- // update (new key)
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update(27, insert_functor<Map>(), false);
- CPPUNIT_ASSERT(!updateResult.first);
- CPPUNIT_ASSERT(!updateResult.second);
- CPPUNIT_ASSERT(!m.contains(27));
-
- updateResult = m.update( 27, insert_functor<Map>() ) ; // value = 54
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( m.contains(27) );
-
- // find test
- check_value chk(10);
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
- chk.m_nExpected = 90;
- CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
- chk.m_nExpected = 54;
- CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
-
- updateResult = m.update( 10, insert_functor<Map>() ) ; // value = 50
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- chk.m_nExpected = 50;
- CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !m.contains(100) );
- CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
-
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 25 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( !m.erase( 25 ));
-
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( m.insert(258))
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(258, less()) );
- CPPUNIT_ASSERT( m.erase_with( 258, less() ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( !m.erase_with( 258, less() ));
-
- int nVal;
- extract_functor ext;
- ext.m_pVal = &nVal;
-
- CPPUNIT_ASSERT( !m.contains(29) );
- CPPUNIT_ASSERT( m.insert(29, 290));
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( nVal == 290 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( nVal == 90 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
- CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
- CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
-
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- chk.m_nExpected = 731;
- CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
- chk.m_nExpected = 941;
- CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
-
- CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
-
- template <class Map>
- void test_int_nogc()
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- {
- Map m( 52, 4 );
-
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- CPPUNIT_ASSERT( m.contains(10) == m.end() );
- iterator it = m.insert( 10 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(10) == it );
- CPPUNIT_ASSERT( it->first == 10 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- CPPUNIT_ASSERT( m.contains(100) == m.end() );
- it = m.insert( 100, 200 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(100, less()) == it );
- CPPUNIT_ASSERT( it->first == 100 );
- CPPUNIT_ASSERT( it->second.m_val == 200 );
-
- CPPUNIT_ASSERT( m.contains(55) == m.end() );
- it = m.insert_with( 55, insert_functor<Map>() );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(55) == it );
- CPPUNIT_ASSERT( it->first == 55 );
- CPPUNIT_ASSERT( it->second.m_val == 55 * 3 );
-
- CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
- CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
- CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
-
- CPPUNIT_ASSERT( m.contains(10) != m.end() );
- std::pair<iterator, bool> updateResult = m.update(10, false);
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( !updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(10) == updateResult.first );
- it = m.contains(10);
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 50 );
-
- CPPUNIT_ASSERT( m.contains(120) == m.end() );
- updateResult = m.update(120, false);
- CPPUNIT_ASSERT(updateResult.first == m.end());
- CPPUNIT_ASSERT(!updateResult.second);
- updateResult = m.update( 120 );
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( m.contains(120, less()) == updateResult.first );
- it = m.contains(120, less());
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
- CPPUNIT_ASSERT( m.contains(120, less()) == m.contains(120) );
-
- // emplace test
- it = m.emplace( 151 ) ; // key = 151, val = 0
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- it = m.emplace( 174, 471 ) ; // key == 174, val = 471
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.emplace( 151, 1051 );
- CPPUNIT_ASSERT( it == m.end());
-
- it = m.contains( 174 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.contains( 190 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.contains( 151 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
- }
-
- // iterator test
-
- {
- Map m( 52, 4 );
-
- for ( int i = 0; i < 500; ++i ) {
- CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
- }
- CPPUNIT_ASSERT( check_size( m, 500 ));
-
- {
- typename Map::iterator it( m.begin() );
- typename Map::const_iterator cit( m.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- }
-
-
- for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- iterator it2 = it;
- CPPUNIT_CHECK( it2 == it );
- CPPUNIT_CHECK( it2 != itEnd );
- CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val );
- it->second = it->first;
- }
-
- Map const& refMap = m;
- for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- }
- }
- }
-
- template <class Map>
- void test_int_nogc_unordered()
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- {
- Map m( 52, 4 );
-
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- CPPUNIT_ASSERT( m.contains(10) == m.end() );
- iterator it = m.insert( 10 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(10) == it );
- CPPUNIT_ASSERT( it->first == 10 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- CPPUNIT_ASSERT( m.contains(100) == m.end() );
- it = m.insert( 100, 200 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(100, equal()) == it );
- CPPUNIT_ASSERT( it->first == 100 );
- CPPUNIT_ASSERT( it->second.m_val == 200 );
-
- CPPUNIT_ASSERT( m.contains(55) == m.end() );
- it = m.insert_with( 55, insert_functor<Map>() );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(55) == it );
- CPPUNIT_ASSERT( it->first == 55 );
- CPPUNIT_ASSERT( it->second.m_val == 55 * 3 );
-
- CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
- CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
- CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
-
- CPPUNIT_ASSERT( m.contains(10) != m.end() );
- std::pair<iterator, bool> updateResult = m.update( 10 );
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( !updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(10) == updateResult.first );
- it = m.contains(10);
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 50 );
-
- CPPUNIT_ASSERT( m.contains(120) == m.end() );
- updateResult = m.update(120, false);
- CPPUNIT_ASSERT(updateResult.first == m.end());
- CPPUNIT_ASSERT(!updateResult.second);
- updateResult = m.update( 120, true );
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( m.contains(120, equal()) == updateResult.first );
- it = m.contains(120, equal());
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
- CPPUNIT_ASSERT( m.contains(120, equal()) == m.contains(120) );
-
- // emplace test
- it = m.emplace( 151 ) ; // key = 151, val = 0
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- it = m.emplace( 174, 471 ) ; // key == 174, val = 471
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.emplace( 151, 1051 );
- CPPUNIT_ASSERT( it == m.end());
-
- it = m.contains( 174 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.contains( 190 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.contains( 151 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
- }
-
- // iterator test
-
- {
- Map m( 52, 4 );
-
- for ( int i = 0; i < 500; ++i ) {
- CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
- }
- CPPUNIT_ASSERT( check_size( m, 500 ));
-
- {
- typename Map::iterator it( m.begin() );
- typename Map::const_iterator cit( m.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != m.end() );
- CPPUNIT_CHECK( it != m.cend() );
- CPPUNIT_CHECK( cit != m.end() );
- CPPUNIT_CHECK( cit != m.cend() );
- }
-
-
- for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- iterator it2 = it;
- CPPUNIT_CHECK( it2 == it );
- CPPUNIT_CHECK( it2 != itEnd );
- CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val );
- it->second = it->first;
- }
-
- Map const& refMap = m;
- for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- }
- }
- }
-
- template <class Map>
- void test_iter()
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- Map s( 100, 4 );
-
- const int nMaxCount = 500;
- for ( int i = 0; i < nMaxCount; ++i ) {
- CPPUNIT_ASSERT( s.insert( i, i * 2 ));
- }
-
- {
- typename Map::iterator it( s.begin() );
- typename Map::const_iterator cit( s.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != s.end() );
- CPPUNIT_CHECK( it != s.cend() );
- CPPUNIT_CHECK( cit != s.end() );
- CPPUNIT_CHECK( cit != s.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != s.end() );
- CPPUNIT_CHECK( it != s.cend() );
- CPPUNIT_CHECK( cit != s.end() );
- CPPUNIT_CHECK( cit != s.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != s.end() );
- CPPUNIT_CHECK( it != s.cend() );
- CPPUNIT_CHECK( cit != s.end() );
- CPPUNIT_CHECK( cit != s.cend() );
- }
-
- int nCount = 0;
- for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first * 2 == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val );
- it->second.m_val = it->first;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
-
- Map const& refSet = s;
- nCount = 0;
- for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
- }
-
-
- void Michael_HP_cmp();
- void Michael_HP_less();
- void Michael_HP_cmpmix();
-
- void Michael_DHP_cmp();
- void Michael_DHP_less();
- void Michael_DHP_cmpmix();
-
- void Michael_RCU_GPI_cmp();
- void Michael_RCU_GPI_less();
- void Michael_RCU_GPI_cmpmix();
-
- void Michael_RCU_GPB_cmp();
- void Michael_RCU_GPB_less();
- void Michael_RCU_GPB_cmpmix();
-
- void Michael_RCU_GPT_cmp();
- void Michael_RCU_GPT_less();
- void Michael_RCU_GPT_cmpmix();
-
- void Michael_RCU_SHB_cmp();
- void Michael_RCU_SHB_less();
- void Michael_RCU_SHB_cmpmix();
-
- void Michael_RCU_SHT_cmp();
- void Michael_RCU_SHT_less();
- void Michael_RCU_SHT_cmpmix();
-
- void Michael_nogc_cmp();
- void Michael_nogc_less();
- void Michael_nogc_cmpmix();
-
- void Lazy_HP_cmp();
- void Lazy_HP_less();
- void Lazy_HP_cmpmix();
-
- void Lazy_DHP_cmp();
- void Lazy_DHP_less();
- void Lazy_DHP_cmpmix();
-
- void Lazy_RCU_GPI_cmp();
- void Lazy_RCU_GPI_less();
- void Lazy_RCU_GPI_cmpmix();
-
- void Lazy_RCU_GPB_cmp();
- void Lazy_RCU_GPB_less();
- void Lazy_RCU_GPB_cmpmix();
-
- void Lazy_RCU_GPT_cmp();
- void Lazy_RCU_GPT_less();
- void Lazy_RCU_GPT_cmpmix();
-
- void Lazy_RCU_SHB_cmp();
- void Lazy_RCU_SHB_less();
- void Lazy_RCU_SHB_cmpmix();
-
- void Lazy_RCU_SHT_cmp();
- void Lazy_RCU_SHT_less();
- void Lazy_RCU_SHT_cmpmix();
-
- void Lazy_nogc_cmp();
- void Lazy_nogc_less();
- void Lazy_nogc_equal();
- void Lazy_nogc_cmpmix();
-
- void Split_HP_cmp();
- void Split_HP_less();
- void Split_HP_cmpmix();
- void Split_HP_cmpmix_stat();
-
- void Split_DHP_cmp();
- void Split_DHP_less();
- void Split_DHP_cmpmix();
- void Split_DHP_cmpmix_stat();
-
- void Split_RCU_GPI_cmp();
- void Split_RCU_GPI_less();
- void Split_RCU_GPI_cmpmix();
- void Split_RCU_GPI_cmpmix_stat();
-
- void Split_RCU_GPB_cmp();
- void Split_RCU_GPB_less();
- void Split_RCU_GPB_cmpmix();
- void Split_RCU_GPB_cmpmix_stat();
-
- void Split_RCU_GPT_cmp();
- void Split_RCU_GPT_less();
- void Split_RCU_GPT_cmpmix();
- void Split_RCU_GPT_cmpmix_stat();
-
- void Split_RCU_SHB_cmp();
- void Split_RCU_SHB_less();
- void Split_RCU_SHB_cmpmix();
- void Split_RCU_SHB_cmpmix_stat();
-
- void Split_RCU_SHT_cmp();
- void Split_RCU_SHT_less();
- void Split_RCU_SHT_cmpmix();
- void Split_RCU_SHT_cmpmix_stat();
-
- void Split_nogc_cmp();
- void Split_nogc_less();
- void Split_nogc_cmpmix();
- void Split_nogc_cmpmix_stat();
-
- void Split_Lazy_HP_cmp();
- void Split_Lazy_HP_less();
- void Split_Lazy_HP_cmpmix();
- void Split_Lazy_HP_cmpmix_stat();
-
- void Split_Lazy_DHP_cmp();
- void Split_Lazy_DHP_less();
- void Split_Lazy_DHP_cmpmix();
- void Split_Lazy_DHP_cmpmix_stat();
-
- void Split_Lazy_RCU_GPI_cmp();
- void Split_Lazy_RCU_GPI_less();
- void Split_Lazy_RCU_GPI_cmpmix();
- void Split_Lazy_RCU_GPI_cmpmix_stat();
-
- void Split_Lazy_RCU_GPB_cmp();
- void Split_Lazy_RCU_GPB_less();
- void Split_Lazy_RCU_GPB_cmpmix();
- void Split_Lazy_RCU_GPB_cmpmix_stat();
-
- void Split_Lazy_RCU_GPT_cmp();
- void Split_Lazy_RCU_GPT_less();
- void Split_Lazy_RCU_GPT_cmpmix();
- void Split_Lazy_RCU_GPT_cmpmix_stat();
-
- void Split_Lazy_RCU_SHB_cmp();
- void Split_Lazy_RCU_SHB_less();
- void Split_Lazy_RCU_SHB_cmpmix();
- void Split_Lazy_RCU_SHB_cmpmix_stat();
-
- void Split_Lazy_RCU_SHT_cmp();
- void Split_Lazy_RCU_SHT_less();
- void Split_Lazy_RCU_SHT_cmpmix();
- void Split_Lazy_RCU_SHT_cmpmix_stat();
-
- void Split_Lazy_nogc_cmp();
- void Split_Lazy_nogc_less();
- void Split_Lazy_nogc_cmpmix();
- void Split_Lazy_nogc_cmpmix_stat();
-
- CPPUNIT_TEST_SUITE(HashMapHdrTest)
- CPPUNIT_TEST(Michael_HP_cmp)
- CPPUNIT_TEST(Michael_HP_less)
- CPPUNIT_TEST(Michael_HP_cmpmix)
-
- CPPUNIT_TEST(Michael_DHP_cmp)
- CPPUNIT_TEST(Michael_DHP_less)
- CPPUNIT_TEST(Michael_DHP_cmpmix)
-
- CPPUNIT_TEST(Michael_RCU_GPI_cmp)
- CPPUNIT_TEST(Michael_RCU_GPI_less)
- CPPUNIT_TEST(Michael_RCU_GPI_cmpmix)
-
- CPPUNIT_TEST(Michael_RCU_GPB_cmp)
- CPPUNIT_TEST(Michael_RCU_GPB_less)
- CPPUNIT_TEST(Michael_RCU_GPB_cmpmix)
-
- CPPUNIT_TEST(Michael_RCU_SHT_cmp)
- CPPUNIT_TEST(Michael_RCU_SHT_less)
- CPPUNIT_TEST(Michael_RCU_SHT_cmpmix)
-
- CPPUNIT_TEST(Michael_RCU_SHB_cmp)
- CPPUNIT_TEST(Michael_RCU_SHB_less)
- CPPUNIT_TEST(Michael_RCU_SHB_cmpmix)
-
- CPPUNIT_TEST(Michael_RCU_GPT_cmp)
- CPPUNIT_TEST(Michael_RCU_GPT_less)
- CPPUNIT_TEST(Michael_RCU_GPT_cmpmix)
-
- CPPUNIT_TEST(Michael_nogc_cmp)
- CPPUNIT_TEST(Michael_nogc_less)
- CPPUNIT_TEST(Michael_nogc_cmpmix)
-
- CPPUNIT_TEST(Lazy_HP_cmp)
- CPPUNIT_TEST(Lazy_HP_less)
- CPPUNIT_TEST(Lazy_HP_cmpmix)
-
- CPPUNIT_TEST(Lazy_DHP_cmp)
- CPPUNIT_TEST(Lazy_DHP_less)
- CPPUNIT_TEST(Lazy_DHP_cmpmix)
-
- CPPUNIT_TEST(Lazy_RCU_GPI_cmp)
- CPPUNIT_TEST(Lazy_RCU_GPI_less)
- CPPUNIT_TEST(Lazy_RCU_GPI_cmpmix)
-
- CPPUNIT_TEST(Lazy_RCU_GPB_cmp)
- CPPUNIT_TEST(Lazy_RCU_GPB_less)
- CPPUNIT_TEST(Lazy_RCU_GPB_cmpmix)
-
- CPPUNIT_TEST(Lazy_RCU_GPT_cmp)
- CPPUNIT_TEST(Lazy_RCU_GPT_less)
- CPPUNIT_TEST(Lazy_RCU_GPT_cmpmix)
-
- CPPUNIT_TEST(Lazy_RCU_SHB_cmp)
- CPPUNIT_TEST(Lazy_RCU_SHB_less)
- CPPUNIT_TEST(Lazy_RCU_SHB_cmpmix)
-
- CPPUNIT_TEST(Lazy_RCU_SHT_cmp)
- CPPUNIT_TEST(Lazy_RCU_SHT_less)
- CPPUNIT_TEST(Lazy_RCU_SHT_cmpmix)
-
- CPPUNIT_TEST(Lazy_nogc_cmp)
- CPPUNIT_TEST(Lazy_nogc_less)
- CPPUNIT_TEST(Lazy_nogc_equal)
- CPPUNIT_TEST(Lazy_nogc_cmpmix)
-
- CPPUNIT_TEST(Split_HP_cmp)
- CPPUNIT_TEST(Split_HP_less)
- CPPUNIT_TEST(Split_HP_cmpmix)
- CPPUNIT_TEST( Split_HP_cmpmix_stat )
-
- CPPUNIT_TEST(Split_DHP_cmp)
- CPPUNIT_TEST(Split_DHP_less)
- CPPUNIT_TEST(Split_DHP_cmpmix)
- CPPUNIT_TEST( Split_DHP_cmpmix_stat )
-
- CPPUNIT_TEST(Split_RCU_GPI_cmp)
- CPPUNIT_TEST(Split_RCU_GPI_less)
- CPPUNIT_TEST(Split_RCU_GPI_cmpmix)
- CPPUNIT_TEST( Split_RCU_GPI_cmpmix_stat )
-
- CPPUNIT_TEST(Split_RCU_GPB_cmp)
- CPPUNIT_TEST(Split_RCU_GPB_less)
- CPPUNIT_TEST(Split_RCU_GPB_cmpmix)
- CPPUNIT_TEST( Split_RCU_GPB_cmpmix_stat )
-
- CPPUNIT_TEST(Split_RCU_GPT_cmp)
- CPPUNIT_TEST(Split_RCU_GPT_less)
- CPPUNIT_TEST(Split_RCU_GPT_cmpmix)
- CPPUNIT_TEST( Split_RCU_GPT_cmpmix_stat )
-
- CPPUNIT_TEST(Split_RCU_SHB_cmp)
- CPPUNIT_TEST(Split_RCU_SHB_less)
- CPPUNIT_TEST(Split_RCU_SHB_cmpmix)
- CPPUNIT_TEST( Split_RCU_SHB_cmpmix_stat )
-
- CPPUNIT_TEST(Split_RCU_SHT_cmp)
- CPPUNIT_TEST(Split_RCU_SHT_less)
- CPPUNIT_TEST(Split_RCU_SHT_cmpmix)
- CPPUNIT_TEST( Split_RCU_SHT_cmpmix_stat )
-
- CPPUNIT_TEST(Split_nogc_cmp)
- CPPUNIT_TEST(Split_nogc_less)
- CPPUNIT_TEST(Split_nogc_cmpmix)
- CPPUNIT_TEST( Split_nogc_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_HP_cmp)
- CPPUNIT_TEST(Split_Lazy_HP_less)
- CPPUNIT_TEST(Split_Lazy_HP_cmpmix)
- CPPUNIT_TEST( Split_Lazy_HP_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_DHP_cmp)
- CPPUNIT_TEST(Split_Lazy_DHP_less)
- CPPUNIT_TEST(Split_Lazy_DHP_cmpmix)
- CPPUNIT_TEST( Split_Lazy_DHP_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmp)
- CPPUNIT_TEST(Split_Lazy_RCU_GPI_less)
- CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmpmix)
- CPPUNIT_TEST( Split_Lazy_RCU_GPI_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmp)
- CPPUNIT_TEST(Split_Lazy_RCU_GPB_less)
- CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmpmix)
- CPPUNIT_TEST( Split_Lazy_RCU_GPB_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmp)
- CPPUNIT_TEST(Split_Lazy_RCU_GPT_less)
- CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmpmix)
- CPPUNIT_TEST( Split_Lazy_RCU_GPT_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmp)
- CPPUNIT_TEST(Split_Lazy_RCU_SHB_less)
- CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmpmix)
- CPPUNIT_TEST( Split_Lazy_RCU_SHB_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmp)
- CPPUNIT_TEST(Split_Lazy_RCU_SHT_less)
- CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmpmix)
- CPPUNIT_TEST( Split_Lazy_RCU_SHT_cmpmix_stat )
-
- CPPUNIT_TEST(Split_Lazy_nogc_cmp)
- CPPUNIT_TEST(Split_Lazy_nogc_less)
- CPPUNIT_TEST(Split_Lazy_nogc_cmpmix)
- CPPUNIT_TEST( Split_Lazy_nogc_cmpmix_stat )
- CPPUNIT_TEST_SUITE_END()
-
- };
-} // namespace map
-
-#endif // #ifndef CDSTEST_HDR_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_kvlist_dhp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- struct DHP_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct DHP_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct DHP_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_DHP_cmp()
- {
- typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Michael_DHP_less()
- {
- typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Michael_DHP_cmpmix()
- {
- typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_kvlist_hp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
-
- struct HP_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct HP_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct HP_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_HP_cmp()
- {
- typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Michael_HP_less()
- {
- typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Michael_HP_cmpmix()
- {
- typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::HashMapHdrTest);
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_kvlist_dhp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- struct DHP_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct DHP_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct DHP_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Lazy_DHP_cmp()
- {
- typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_DHP_less()
- {
- typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_DHP_cmpmix()
- {
- typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::DHP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_kvlist_hp.h>
-#include <cds/container/michael_map.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- struct HP_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct HP_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct HP_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Lazy_HP_cmp()
- {
- typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_HP_less()
- {
- typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_HP_cmpmix()
- {
- typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map;
- test_int< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::HP, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_kvlist_nogc.h>
-#include <cds/container/michael_map_nogc.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- struct nogc_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct nogc_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct nogc_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
-
- struct nogc_equal_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::equal equal_to;
- static const bool sort = false;
- };
- }
-
- void HashMapHdrTest::Lazy_nogc_cmp()
- {
- typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_nogc_less()
- {
- typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_nogc_equal()
- {
- typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_equal_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc_unordered< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc_unordered< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_nogc_cmpmix()
- {
- typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPB_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPB_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Lazy_RCU_GPB_cmp()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPB_less()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPB_cmpmix()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPI_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPI_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Lazy_RCU_GPI_cmp()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPI_less()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPI_cmpmix()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPT_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPT_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Lazy_RCU_GPT_cmp()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPT_less()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Lazy_RCU_GPT_cmpmix()
- {
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_SHB_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-#endif
-
- void HashMapHdrTest::Lazy_RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Lazy_RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Lazy_RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_SHT_less_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-#endif
-
- void HashMapHdrTest::Lazy_RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Lazy_RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Lazy_RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_kvlist_nogc.h>
-#include <cds/container/michael_map_nogc.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- struct nogc_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct nogc_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct nogc_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_nogc_cmp()
- {
- typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Michael_nogc_less()
- {
- typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Michael_nogc_cmpmix()
- {
- typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map;
- test_int_nogc< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< cds::gc::nogc, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/michael_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPB_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPB_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_RCU_GPB_cmp()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPB_less()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPB_cmpmix()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/michael_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPI_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPI_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_RCU_GPI_cmp()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPI_less()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPI_cmpmix()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/michael_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_GPT_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_GPT_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-
- void HashMapHdrTest::Michael_RCU_GPT_cmp()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPT_less()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
- void HashMapHdrTest::Michael_RCU_GPT_cmpmix()
- {
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
- }
-
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/michael_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_SHB_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-#endif
-
- void HashMapHdrTest::Michael_RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Michael_RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Michael_RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/michael_kvlist_rcu.h>
-#include <cds/container/michael_map_rcu.h>
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct map_traits: public cc::michael_map::traits
- {
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- };
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
-
- struct RCU_SHT_less_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
-
- struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef HashMapHdrTest::less less;
- };
- }
-#endif
-
- void HashMapHdrTest::Michael_RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmp_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Michael_RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_less_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Michael_RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmpmix_traits > list;
-
- // traits-based version
- typedef cc::MichaelHashMap< rcu_type, list, map_traits > map;
- test_rcu_michael_list< map >();
-
- // option-based version
- typedef cc::MichaelHashMap< rcu_type, list,
- cc::michael_map::make_traits<
- cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- >::type
- > opt_map;
- test_rcu_michael_list< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Refinable_boost_flat_map()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_map you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_flat_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::flat_map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
-
- }
-} // namespace map
-
-/*
-#else
- namespace map {
- void StripedMapHdrTest::Refinable_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map is not compatible with MS VC++ 11" );
- }
- }
-#endif
-*/
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Refinable_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Refinable_boost_list()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::list you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_list.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::list< StripedMapHdrTest::pair_type > sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second ));
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_boost_list()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
- }
-
-} // namespace map
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Refinable_boost_list()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::list you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Refinable_boost_map()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::map you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_boost_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
-
- }
-} // namespace map
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Refinable_boost_map()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::map you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/boost_unordered_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( std::make_pair(itWhat->first, itWhat->second ) );
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_boost_unordered_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
-
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_hash_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( std::make_pair(itWhat->first, itWhat->second ) );
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_hashmap()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_list.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::list<StripedMapHdrTest::pair_type> sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second ));
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_list()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- , co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
- }
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
-
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Refinable_slist()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::slist you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_slist.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-
-namespace map {
-
- namespace {
- typedef boost::container::slist<StripedMapHdrTest::pair_type> sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert_after( itInsert, StripedMapHdrTest::pair_type( std::make_pair(itWhat->first, itWhat->second )));
- }
- };
- }
-
- void StripedMapHdrTest::Refinable_slist()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- , co::mutex_policy< cc::striped_set::refinable<cds::sync::spin> >
- , co::hash< hash_int >
- , co::less< less >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::refinable<> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
- }
-} // namespace map
-#else
-
-namespace map {
- void StripedMapHdrTest::Refinable_slist()
- {
- CPPUNIT_MESSAGE("Skipped; for boost::container::slist you should use boost version 1.48 or above");
- }
-} // namespace map
-
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_SKIPLIST_MAP_H
-#define CDSTEST_HDR_SKIPLIST_MAP_H
-
-#include "map/hdr_map.h"
-
-namespace map {
-
- class SkipListMapHdrTest: public HashMapHdrTest
- {
- typedef HashMapHdrTest base_class;
- typedef base_class::other_item wrapped_item;
- typedef base_class::other_less wrapped_less;
-
- template <class Map, typename PrintStat >
- void test()
- {
- Map m;
- test_int_with( m );
-
- static int const nLimit = 10000;
- typedef typename Map::iterator set_iterator;
- typedef typename Map::const_iterator const_set_iterator;
-
- int nCount = 0;
- int nPrevKey = 0;
-
- // Test iterator - ascending order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
-
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( m.insert(i, i) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, ascending insert order") );
-
- nCount = 0;
- nPrevKey = 0;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first * 2;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- // Test iterator - descending order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
-
- for ( int i = nLimit; i > 0; --i ) {
- CPPUNIT_ASSERT( m.insert( i - 1, (i-1) * 2) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, descending insert order") );
-
- nCount = 0;
- nPrevKey = 0;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- // Test iterator - random order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- {
- int nRand[nLimit];
- for ( int i = 0; i < nLimit; ++i ) {
- nRand[i] = i;
- }
- shuffle( nRand, nRand + nLimit );
-
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( m.insert( nRand[i], nRand[i]) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, random insert order") );
- }
-
- nCount = 0;
- nPrevKey = 0;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first * 2;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- {
- typename Map::guarded_ptr gp;
- int arrItem[nLimit];
- for ( int i = 0; i < nLimit; ++i )
- arrItem[i] = i;
- shuffle( arrItem, arrItem + nLimit );
-
- typedef base_class::less less;
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrItem[i];
- gp = m.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = m.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = m.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( !m.extract(nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( m.empty());
-
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrItem[i];
- gp = m.get_with( wrapped_item( nKey ), wrapped_less());
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = m.extract_with( wrapped_item( nKey ), wrapped_less());
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = m.get_with( wrapped_item( nKey ), wrapped_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( !m.extract_with( wrapped_item(nKey), wrapped_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( m.empty());
-
- //extract_min
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
-
- for ( int i = 0; i < nLimit; ++i ) {
- gp = m.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == i );
- CPPUNIT_CHECK( gp->second.m_val == i * 2 );
- gp.release();
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_CHECK( !m.extract_min());
-
- // extract_max
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
-
- for ( int i = nLimit - 1; i >= 0; --i ) {
- gp = m.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == i );
- CPPUNIT_CHECK( gp->second.m_val == i * 2 );
- gp.release();
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_CHECK( !m.extract_max());
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_ASSERT( m.empty());
- }
-
- CPPUNIT_MSG( PrintStat()(m, nullptr) );
- }
-
- template <class Map, typename PrintStat >
- void test_nogc()
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- Map m;
-
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- CPPUNIT_ASSERT( m.contains(10) == m.end() );
- iterator it = m.insert( 10 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 10 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(10) == it );
- CPPUNIT_ASSERT( it->first == 10 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- CPPUNIT_ASSERT( m.contains(100) == m.end() );
- it = m.insert( 100, 200 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(100) == it );
- CPPUNIT_ASSERT( it->first == 100 );
- CPPUNIT_ASSERT( it->second.m_val == 200 );
-
- CPPUNIT_ASSERT( m.contains(55) == m.end() );
- it = m.insert_with( 55, insert_functor<Map>() );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(55) == it );
- CPPUNIT_ASSERT( it->first == 55 );
- CPPUNIT_ASSERT( it->second.m_val == 55 * 3 );
-
- CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
- CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
- CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
-
- CPPUNIT_ASSERT( m.contains(10) != m.end() );
- std::pair<iterator, bool> updateResult = m.update( 10, false );
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( !updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(10) == updateResult.first );
- it = m.contains( 10, typename base_class::less() );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 50 );
-
- CPPUNIT_ASSERT( m.contains(120, base_class::less()) == m.end() );
- updateResult = m.update(120, false);
- CPPUNIT_ASSERT(updateResult.first == m.end());
- CPPUNIT_ASSERT(!updateResult.second);
- updateResult = m.update( 120 );
- CPPUNIT_ASSERT( updateResult.first != m.end() );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- updateResult.first->second.m_val = updateResult.first->first * 5;
- CPPUNIT_ASSERT( m.contains(120, base_class::less()) == updateResult.first );
- it = m.contains(120, base_class::less());
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
-
- // emplace test
- it = m.emplace( 151 ) ; // key = 151, val = 0
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- it = m.emplace( 174, 471 ) ; // key == 174, val = 471
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.emplace( 151, 1051 );
- CPPUNIT_ASSERT( it == m.end());
-
- it = m.contains( 174 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 174 );
- CPPUNIT_ASSERT( it->second.m_val == 471 );
-
- it = m.contains( 190 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 190 );
- CPPUNIT_ASSERT( it->second.m_val == 91 );
-
- it = m.contains( 151 );
- CPPUNIT_ASSERT( it != m.end() );
- CPPUNIT_ASSERT( it->first == 151 );
- CPPUNIT_ASSERT( it->second.m_val == 0 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // get_min test
- for ( int i = 500; i > 0; --i ) {
- CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
-
- typename Map::value_type * pVal = m.get_min();
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == i );
- CPPUNIT_CHECK( pVal->second.m_val == i * 2 );
- }
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_CHECK( m.get_min() == nullptr );
- CPPUNIT_CHECK( m.get_max() == nullptr );
-
- // iterator test
-
- for ( int i = 0; i < 500; ++i ) {
- CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
-
- typename Map::value_type * pVal = m.get_max();
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == i );
- CPPUNIT_CHECK( pVal->second.m_val == i * 2 );
- }
- CPPUNIT_ASSERT( check_size( m, 500 ));
-
- for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val );
- it->second = it->first;
- }
-
- Map const& refMap = m;
- for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- }
-
- CPPUNIT_MSG( PrintStat()(m, "SkipListMap statistics") );
- }
-
- public:
- void SkipList_HP_less();
- void SkipList_HP_cmp();
- void SkipList_HP_cmpless();
- void SkipList_HP_less_stat();
- void SkipList_HP_cmp_stat();
- void SkipList_HP_cmpless_stat();
- void SkipList_HP_xorshift_less();
- void SkipList_HP_xorshift_cmp();
- void SkipList_HP_xorshift_cmpless();
- void SkipList_HP_xorshift_less_stat();
- void SkipList_HP_xorshift_cmp_stat();
- void SkipList_HP_xorshift_cmpless_stat();
- void SkipList_HP_turbopas_less();
- void SkipList_HP_turbopas_cmp();
- void SkipList_HP_turbopas_cmpless();
- void SkipList_HP_turbopas_less_stat();
- void SkipList_HP_turbopas_cmp_stat();
- void SkipList_HP_turbopas_cmpless_stat();
- void SkipList_HP_michaelalloc_less();
- void SkipList_HP_michaelalloc_cmp();
- void SkipList_HP_michaelalloc_cmpless();
- void SkipList_HP_michaelalloc_less_stat();
- void SkipList_HP_michaelalloc_cmp_stat();
- void SkipList_HP_michaelalloc_cmpless_stat();
-
- void SkipList_DHP_less();
- void SkipList_DHP_cmp();
- void SkipList_DHP_cmpless();
- void SkipList_DHP_less_stat();
- void SkipList_DHP_cmp_stat();
- void SkipList_DHP_cmpless_stat();
- void SkipList_DHP_xorshift_less();
- void SkipList_DHP_xorshift_cmp();
- void SkipList_DHP_xorshift_cmpless();
- void SkipList_DHP_xorshift_less_stat();
- void SkipList_DHP_xorshift_cmp_stat();
- void SkipList_DHP_xorshift_cmpless_stat();
- void SkipList_DHP_turbopas_less();
- void SkipList_DHP_turbopas_cmp();
- void SkipList_DHP_turbopas_cmpless();
- void SkipList_DHP_turbopas_less_stat();
- void SkipList_DHP_turbopas_cmp_stat();
- void SkipList_DHP_turbopas_cmpless_stat();
- void SkipList_DHP_michaelalloc_less();
- void SkipList_DHP_michaelalloc_cmp();
- void SkipList_DHP_michaelalloc_cmpless();
- void SkipList_DHP_michaelalloc_less_stat();
- void SkipList_DHP_michaelalloc_cmp_stat();
- void SkipList_DHP_michaelalloc_cmpless_stat();
-
- void SkipList_NOGC_less();
- void SkipList_NOGC_cmp();
- void SkipList_NOGC_cmpless();
- void SkipList_NOGC_less_stat();
- void SkipList_NOGC_cmp_stat();
- void SkipList_NOGC_cmpless_stat();
- void SkipList_NOGC_xorshift_less();
- void SkipList_NOGC_xorshift_cmp();
- void SkipList_NOGC_xorshift_cmpless();
- void SkipList_NOGC_xorshift_less_stat();
- void SkipList_NOGC_xorshift_cmp_stat();
- void SkipList_NOGC_xorshift_cmpless_stat();
- void SkipList_NOGC_turbopas_less();
- void SkipList_NOGC_turbopas_cmp();
- void SkipList_NOGC_turbopas_cmpless();
- void SkipList_NOGC_turbopas_less_stat();
- void SkipList_NOGC_turbopas_cmp_stat();
- void SkipList_NOGC_turbopas_cmpless_stat();
- void SkipList_NOGC_michaelalloc_less();
- void SkipList_NOGC_michaelalloc_cmp();
- void SkipList_NOGC_michaelalloc_cmpless();
- void SkipList_NOGC_michaelalloc_less_stat();
- void SkipList_NOGC_michaelalloc_cmp_stat();
- void SkipList_NOGC_michaelalloc_cmpless_stat();
-
- CPPUNIT_TEST_SUITE(SkipListMapHdrTest)
- CPPUNIT_TEST(SkipList_HP_less)
- CPPUNIT_TEST(SkipList_HP_cmp)
- CPPUNIT_TEST(SkipList_HP_cmpless)
- CPPUNIT_TEST(SkipList_HP_less_stat)
- CPPUNIT_TEST(SkipList_HP_cmp_stat)
- CPPUNIT_TEST(SkipList_HP_cmpless_stat)
- CPPUNIT_TEST(SkipList_HP_xorshift_less)
- CPPUNIT_TEST(SkipList_HP_xorshift_cmp)
- CPPUNIT_TEST(SkipList_HP_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_HP_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_HP_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_HP_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_HP_turbopas_less)
- CPPUNIT_TEST(SkipList_HP_turbopas_cmp)
- CPPUNIT_TEST(SkipList_HP_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_HP_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_HP_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_HP_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_less)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_HP_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_DHP_less)
- CPPUNIT_TEST(SkipList_DHP_cmp)
- CPPUNIT_TEST(SkipList_DHP_cmpless)
- CPPUNIT_TEST(SkipList_DHP_less_stat)
- CPPUNIT_TEST(SkipList_DHP_cmp_stat)
- CPPUNIT_TEST(SkipList_DHP_cmpless_stat)
- CPPUNIT_TEST(SkipList_DHP_xorshift_less)
- CPPUNIT_TEST(SkipList_DHP_xorshift_cmp)
- CPPUNIT_TEST(SkipList_DHP_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_DHP_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_DHP_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_DHP_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_DHP_turbopas_less)
- CPPUNIT_TEST(SkipList_DHP_turbopas_cmp)
- CPPUNIT_TEST(SkipList_DHP_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_DHP_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_DHP_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_DHP_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_less)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_NOGC_less)
- CPPUNIT_TEST(SkipList_NOGC_cmp)
- CPPUNIT_TEST(SkipList_NOGC_cmpless)
- CPPUNIT_TEST(SkipList_NOGC_less_stat)
- CPPUNIT_TEST(SkipList_NOGC_cmp_stat)
- CPPUNIT_TEST(SkipList_NOGC_cmpless_stat)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_less)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_cmp)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_NOGC_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_less)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_cmp)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_NOGC_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_less)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST_SUITE_END()
-
- };
-
-} // namespace map
-
-#endif // #ifndef CDSTEST_HDR_SKIPLIST_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map.h"
-#include <cds/container/skip_list_map_dhp.h>
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
-
- void SkipListMapHdrTest::SkipList_DHP_less()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_cmp()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_less()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_cmp()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_less()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_cmp()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_less()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map.h"
-#include <cds/container/skip_list_map_hp.h>
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
-
- void SkipListMapHdrTest::SkipList_HP_less()
- {
- struct map_traits : public cc::skip_list::traits
- {
- typedef SkipListMapHdrTest::less less;
- typedef simple_item_counter item_counter;
- };
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, map_traits > set;
- test< set, misc::print_skiplist_stat<set::stat > >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_cmp()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_less()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_cmp()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_less()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_cmp()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_less()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::SkipListMapHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map.h"
-#include <cds/container/skip_list_map_nogc.h>
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
-
- void SkipListMapHdrTest::SkipList_NOGC_less()
- {
- struct map_traits : public cc::skip_list::traits
- {
- typedef SkipListMapHdrTest::less less;
- typedef simple_item_counter item_counter;
- };
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, map_traits > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_cmp()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_less()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_less()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test_nogc< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_SKIPLIST_MAP_RCU_H
-#define CDSTEST_HDR_SKIPLIST_MAP_RCU_H
-
-#include "map/hdr_map.h"
-
-namespace map {
-
- class SkipListMapRCUHdrTest: public HashMapHdrTest
- {
- typedef HashMapHdrTest base_class;
- typedef base_class::other_item wrapped_item;
- typedef base_class::other_less wrapped_less;
-
- template <class Map, typename PrintStat >
- void test()
- {
- Map m;
- test_int_with( m );
-
- static int const nLimit = 10000;
- typedef typename Map::iterator set_iterator;
- typedef typename Map::const_iterator const_set_iterator;
- typedef typename Map::gc::scoped_lock rcu_lock;
-
- int nCount = 0;
- int nPrevKey = 0;
-
- // Test iterator - ascending order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
-
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( m.insert(i, i) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, ascending insert order") );
-
- nCount = 0;
- nPrevKey = 0;
- {
- rcu_lock sl;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first * 2;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- {
- rcu_lock sl;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- // Test iterator - descending order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
-
- for ( int i = nLimit; i > 0; --i ) {
- CPPUNIT_ASSERT( m.insert( i - 1, (i-1) * 2) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, descending insert order") );
-
- nCount = 0;
- nPrevKey = 0;
- {
- rcu_lock sl;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- {
- rcu_lock sl;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- // Test iterator - random order
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- {
- int nRand[nLimit];
- for ( int i = 0; i < nLimit; ++i ) {
- nRand[i] = i;
- }
- shuffle( nRand, nRand + nLimit );
-
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( m.insert(i, i) );
- }
- CPPUNIT_MSG( PrintStat()(m, "Iterator test, random insert order") );
- }
-
- nCount = 0;
- nPrevKey = 0;
- {
- rcu_lock sl;
- for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first == it->second.m_val );
- CPPUNIT_ASSERT( m.contains( it->first ));
- it->second.m_val = (*it).first * 2;
- ++nCount;
- if ( it != m.begin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- nCount = 0;
- {
- rcu_lock sl;
- for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val );
- ++nCount;
- if ( it != m.cbegin() ) {
- CPPUNIT_ASSERT( nPrevKey + 1 == it->first );
- }
- nPrevKey = it->first;
- }
- }
- CPPUNIT_ASSERT( nCount == nLimit );
-
- {
- int arrItem[nLimit];
- for ( int i = 0; i < nLimit; ++i )
- arrItem[i] = i;
- shuffle( arrItem, arrItem + nLimit );
-
- typedef typename Map::value_type value_type;
- typename Map::exempt_ptr ep;
- typename Map::raw_ptr rp;
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrItem[i];
- {
- rcu_lock l;
- rp = m.get( nKey );
- CPPUNIT_ASSERT( rp );
- CPPUNIT_CHECK( rp->first == nKey );
- CPPUNIT_CHECK( rp->second.m_val == nKey * 2 );
- }
- rp.release();
-
- ep = m.extract( nKey );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == nKey );
- CPPUNIT_CHECK( ep->second.m_val == nKey * 2 );
- ep.release();
-
- {
- rcu_lock l;
- CPPUNIT_CHECK( !m.get( nKey ));
- }
- ep = m.extract( nKey );
- CPPUNIT_CHECK( !ep );
- }
- CPPUNIT_ASSERT( m.empty() );
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
-
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arrItem[i];
- {
- rcu_lock l;
- rp = m.get_with( wrapped_item(nKey), wrapped_less() );
- CPPUNIT_ASSERT( rp );
- CPPUNIT_CHECK( rp->first == nKey );
- CPPUNIT_CHECK( rp->second.m_val == nKey * 2 );
- }
- rp.release();
-
- ep = m.extract_with( wrapped_item( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == nKey );
- CPPUNIT_CHECK( ep->second.m_val == nKey * 2 );
- ep.release();
-
- {
- rcu_lock l;
- CPPUNIT_CHECK( !m.get_with( wrapped_item(nKey), wrapped_less() ));
- }
- ep = m.extract_with( wrapped_item( nKey ), wrapped_less() );
- CPPUNIT_CHECK( !ep );
- }
- CPPUNIT_ASSERT( m.empty() );
-
- // extract_min
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
- for ( int i = 0; i < nLimit; ++i ) {
- ep = m.extract_min();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == i );
- CPPUNIT_CHECK( ep->second.m_val == i * 2 );
- ep.release();
- }
- CPPUNIT_ASSERT( m.empty() );
- ep = m.extract_min();
- CPPUNIT_CHECK( !ep );
-
- // extract_max
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) );
- for ( int i = nLimit-1; i >= 0; --i ) {
- ep = m.extract_max();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == i );
- CPPUNIT_CHECK( ep->second.m_val == i * 2 );
- ep.release();
- }
- CPPUNIT_ASSERT( m.empty() );
- ep = m.extract_max();
- CPPUNIT_CHECK( !ep );
- }
-
- CPPUNIT_MSG( PrintStat()(m, nullptr) );
- }
-
- public:
- void SkipList_RCU_GPI_less();
- void SkipList_RCU_GPI_cmp();
- void SkipList_RCU_GPI_cmpless();
- void SkipList_RCU_GPI_less_stat();
- void SkipList_RCU_GPI_cmp_stat();
- void SkipList_RCU_GPI_cmpless_stat();
- void SkipList_RCU_GPI_xorshift_less();
- void SkipList_RCU_GPI_xorshift_cmp();
- void SkipList_RCU_GPI_xorshift_cmpless();
- void SkipList_RCU_GPI_xorshift_less_stat();
- void SkipList_RCU_GPI_xorshift_cmp_stat();
- void SkipList_RCU_GPI_xorshift_cmpless_stat();
- void SkipList_RCU_GPI_turbopas_less();
- void SkipList_RCU_GPI_turbopas_cmp();
- void SkipList_RCU_GPI_turbopas_cmpless();
- void SkipList_RCU_GPI_turbopas_less_stat();
- void SkipList_RCU_GPI_turbopas_cmp_stat();
- void SkipList_RCU_GPI_turbopas_cmpless_stat();
- void SkipList_RCU_GPI_michaelalloc_less();
- void SkipList_RCU_GPI_michaelalloc_cmp();
- void SkipList_RCU_GPI_michaelalloc_cmpless();
- void SkipList_RCU_GPI_michaelalloc_less_stat();
- void SkipList_RCU_GPI_michaelalloc_cmp_stat();
- void SkipList_RCU_GPI_michaelalloc_cmpless_stat();
-
- void SkipList_RCU_GPB_less();
- void SkipList_RCU_GPB_cmp();
- void SkipList_RCU_GPB_cmpless();
- void SkipList_RCU_GPB_less_stat();
- void SkipList_RCU_GPB_cmp_stat();
- void SkipList_RCU_GPB_cmpless_stat();
- void SkipList_RCU_GPB_xorshift_less();
- void SkipList_RCU_GPB_xorshift_cmp();
- void SkipList_RCU_GPB_xorshift_cmpless();
- void SkipList_RCU_GPB_xorshift_less_stat();
- void SkipList_RCU_GPB_xorshift_cmp_stat();
- void SkipList_RCU_GPB_xorshift_cmpless_stat();
- void SkipList_RCU_GPB_turbopas_less();
- void SkipList_RCU_GPB_turbopas_cmp();
- void SkipList_RCU_GPB_turbopas_cmpless();
- void SkipList_RCU_GPB_turbopas_less_stat();
- void SkipList_RCU_GPB_turbopas_cmp_stat();
- void SkipList_RCU_GPB_turbopas_cmpless_stat();
- void SkipList_RCU_GPB_michaelalloc_less();
- void SkipList_RCU_GPB_michaelalloc_cmp();
- void SkipList_RCU_GPB_michaelalloc_cmpless();
- void SkipList_RCU_GPB_michaelalloc_less_stat();
- void SkipList_RCU_GPB_michaelalloc_cmp_stat();
- void SkipList_RCU_GPB_michaelalloc_cmpless_stat();
-
- void SkipList_RCU_GPT_less();
- void SkipList_RCU_GPT_cmp();
- void SkipList_RCU_GPT_cmpless();
- void SkipList_RCU_GPT_less_stat();
- void SkipList_RCU_GPT_cmp_stat();
- void SkipList_RCU_GPT_cmpless_stat();
- void SkipList_RCU_GPT_xorshift_less();
- void SkipList_RCU_GPT_xorshift_cmp();
- void SkipList_RCU_GPT_xorshift_cmpless();
- void SkipList_RCU_GPT_xorshift_less_stat();
- void SkipList_RCU_GPT_xorshift_cmp_stat();
- void SkipList_RCU_GPT_xorshift_cmpless_stat();
- void SkipList_RCU_GPT_turbopas_less();
- void SkipList_RCU_GPT_turbopas_cmp();
- void SkipList_RCU_GPT_turbopas_cmpless();
- void SkipList_RCU_GPT_turbopas_less_stat();
- void SkipList_RCU_GPT_turbopas_cmp_stat();
- void SkipList_RCU_GPT_turbopas_cmpless_stat();
- void SkipList_RCU_GPT_michaelalloc_less();
- void SkipList_RCU_GPT_michaelalloc_cmp();
- void SkipList_RCU_GPT_michaelalloc_cmpless();
- void SkipList_RCU_GPT_michaelalloc_less_stat();
- void SkipList_RCU_GPT_michaelalloc_cmp_stat();
- void SkipList_RCU_GPT_michaelalloc_cmpless_stat();
-
- void SkipList_RCU_SHB_less();
- void SkipList_RCU_SHB_cmp();
- void SkipList_RCU_SHB_cmpless();
- void SkipList_RCU_SHB_less_stat();
- void SkipList_RCU_SHB_cmp_stat();
- void SkipList_RCU_SHB_cmpless_stat();
- void SkipList_RCU_SHB_xorshift_less();
- void SkipList_RCU_SHB_xorshift_cmp();
- void SkipList_RCU_SHB_xorshift_cmpless();
- void SkipList_RCU_SHB_xorshift_less_stat();
- void SkipList_RCU_SHB_xorshift_cmp_stat();
- void SkipList_RCU_SHB_xorshift_cmpless_stat();
- void SkipList_RCU_SHB_turbopas_less();
- void SkipList_RCU_SHB_turbopas_cmp();
- void SkipList_RCU_SHB_turbopas_cmpless();
- void SkipList_RCU_SHB_turbopas_less_stat();
- void SkipList_RCU_SHB_turbopas_cmp_stat();
- void SkipList_RCU_SHB_turbopas_cmpless_stat();
- void SkipList_RCU_SHB_michaelalloc_less();
- void SkipList_RCU_SHB_michaelalloc_cmp();
- void SkipList_RCU_SHB_michaelalloc_cmpless();
- void SkipList_RCU_SHB_michaelalloc_less_stat();
- void SkipList_RCU_SHB_michaelalloc_cmp_stat();
- void SkipList_RCU_SHB_michaelalloc_cmpless_stat();
-
- void SkipList_RCU_SHT_less();
- void SkipList_RCU_SHT_cmp();
- void SkipList_RCU_SHT_cmpless();
- void SkipList_RCU_SHT_less_stat();
- void SkipList_RCU_SHT_cmp_stat();
- void SkipList_RCU_SHT_cmpless_stat();
- void SkipList_RCU_SHT_xorshift_less();
- void SkipList_RCU_SHT_xorshift_cmp();
- void SkipList_RCU_SHT_xorshift_cmpless();
- void SkipList_RCU_SHT_xorshift_less_stat();
- void SkipList_RCU_SHT_xorshift_cmp_stat();
- void SkipList_RCU_SHT_xorshift_cmpless_stat();
- void SkipList_RCU_SHT_turbopas_less();
- void SkipList_RCU_SHT_turbopas_cmp();
- void SkipList_RCU_SHT_turbopas_cmpless();
- void SkipList_RCU_SHT_turbopas_less_stat();
- void SkipList_RCU_SHT_turbopas_cmp_stat();
- void SkipList_RCU_SHT_turbopas_cmpless_stat();
- void SkipList_RCU_SHT_michaelalloc_less();
- void SkipList_RCU_SHT_michaelalloc_cmp();
- void SkipList_RCU_SHT_michaelalloc_cmpless();
- void SkipList_RCU_SHT_michaelalloc_less_stat();
- void SkipList_RCU_SHT_michaelalloc_cmp_stat();
- void SkipList_RCU_SHT_michaelalloc_cmpless_stat();
-
- CPPUNIT_TEST_SUITE(SkipListMapRCUHdrTest)
- CPPUNIT_TEST(SkipList_RCU_GPI_less)
- CPPUNIT_TEST(SkipList_RCU_GPI_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPI_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPI_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_less)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_less)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_less)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_RCU_GPB_less)
- CPPUNIT_TEST(SkipList_RCU_GPB_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPB_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPB_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_less)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_less)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_less)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_RCU_GPT_less)
- CPPUNIT_TEST(SkipList_RCU_GPT_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPT_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPT_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_less)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_less)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_less)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_RCU_SHB_less)
- CPPUNIT_TEST(SkipList_RCU_SHB_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHB_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHB_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_less)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_less)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_less)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST(SkipList_RCU_SHT_less)
- CPPUNIT_TEST(SkipList_RCU_SHT_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHT_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHT_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_less)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_less)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmpless_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_less)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmp)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmpless)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_less_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmp_stat)
- CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmpless_stat)
-
- CPPUNIT_TEST_SUITE_END()
-
- };
-
-} // namespace map
-
-#endif // #ifndef CDSTEST_HDR_SKIPLIST_MAP_RCU_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map_rcu.h"
-
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/skip_list_map_rcu.h>
-
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_less()
- {
- struct map_traits : public cc::skip_list::traits
- {
- typedef SkipListMapRCUHdrTest::less less;
- typedef simple_item_counter item_counter;
- };
- typedef cc::SkipListMap< rcu_type, key_type, value_type, map_traits > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map_rcu.h"
-
-#include <cds/urcu/general_instant.h>
-#include <cds/container/skip_list_map_rcu.h>
-
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::SkipListMapRCUHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map_rcu.h"
-
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/skip_list_map_rcu.h>
-
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_less()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmp()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmpless()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_less_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmp_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmpless_stat()
- {
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
- }
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map_rcu.h"
-
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/skip_list_map_rcu.h>
-
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
- }
-#endif
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_skiplist_map_rcu.h"
-
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/skip_list_map_rcu.h>
-
-#include "unit/michael_alloc.h"
-#include "map/print_skiplist_stat.h"
-
-namespace map {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
- }
-#endif
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
- void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmpless_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::SkipListMap< rcu_type, key_type, value_type,
- cc::skip_list::make_traits<
- co::less< less >
- ,co::compare< cmp >
- ,co::item_counter< simple_item_counter >
- ,co::stat< cc::skip_list::stat<> >
- ,co::allocator< memory::MichaelAllocator<int> >
- >::type
- > set;
- test< set, misc::print_skiplist_stat<set::stat> >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_list_dhp.h>
-#include <cds/container/split_list_map.h>
-
-namespace map {
-
- namespace {
- struct DHP_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct DHP_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct DHP_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct DHP_cmpmix_stat_traits : public DHP_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_DHP_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_DHP_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_less_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_DHP_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_DHP_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_stat_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_list_hp.h>
-#include <cds/container/split_list_map.h>
-
-namespace map {
-
- namespace {
- struct HP_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct HP_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct HP_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct HP_cmpmix_stat_traits : public HP_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
-
- }
-
- void HashMapHdrTest::Split_HP_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_HP_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_HP_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_HP_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_stat_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- ,cds::opt::stat< cc::split_list::stat<>>
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_list_dhp.h>
-#include <cds/container/split_list_map.h>
-
-namespace map {
-
- namespace {
- struct DHP_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct DHP_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct DHP_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct DHP_cmpmix_stat_traits : public DHP_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_Lazy_DHP_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_DHP_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_less_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_DHP_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_DHP_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_stat_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::DHP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- ,cc::opt::stat< cc::split_list::stat<>>
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_list_hp.h>
-#include <cds/container/split_list_map.h>
-
-namespace map {
-
- namespace {
- struct HP_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct HP_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct HP_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct HP_cmpmix_stat_traits : public HP_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_Lazy_HP_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_HP_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_HP_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_HP_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_stat_traits > map_type;
- test_int< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::HP,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- ,cc::opt::stat< cc::split_list::stat<>>
- >::type
- > opt_map;
- test_int< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/lazy_list_nogc.h>
-#include <cds/container/split_list_map_nogc.h>
-
-namespace map {
-
- namespace {
- struct nogc_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct nogc_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct nogc_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct nogc_cmpmix_stat_traits : public nogc_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_Lazy_nogc_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmp_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_nogc_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_less_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_nogc_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_nogc_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_stat_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cds::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/lazy_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPB_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPB_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_less_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPB_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/lazy_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPI_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPI_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_less_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPI_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/lazy_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPT_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
-
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPT_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_less_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_GPT_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/lazy_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_SHB_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
-
- }
-#endif
-
- void HashMapHdrTest::Split_Lazy_RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_less_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHB_cmpmix_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/lazy_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_SHT_less_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::lazy_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::lazy_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
-}
-#endif
-
- void HashMapHdrTest::Split_Lazy_RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_less_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_Lazy_RCU_SHT_cmpmix_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::lazy_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::lazy_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/container/michael_list_nogc.h>
-#include <cds/container/split_list_map_nogc.h>
-
-namespace map {
-
- namespace {
- struct nogc_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct nogc_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct nogc_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct nogc_cmpmix_stat_traits : public nogc_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_nogc_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmp_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_nogc_less()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_less_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_nogc_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- , cc::opt::stat< cc::split_list::empty_stat >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
- void HashMapHdrTest::Split_nogc_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_stat_traits > map_type;
- test_int_nogc< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< cds::gc::nogc,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat< cc::split_list::stat<> >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_int_nogc< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/michael_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPB_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPB_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_less_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPB_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cds::opt::stat< cc::split_list::stat<>>
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/michael_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPI_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
-
- }
-
- void HashMapHdrTest::Split_RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPI_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_less_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPI_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cds::opt::stat< cc::split_list::stat<>>
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/michael_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_GPT_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-
- void HashMapHdrTest::Split_RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPT_less()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_less_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
- void HashMapHdrTest::Split_RCU_GPT_cmpmix_stat()
- {
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cds::opt::stat< cc::split_list::stat<>>
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
- }
-
-} // namespace map
-
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/michael_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_SHB_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-#endif
-
- void HashMapHdrTest::Split_RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_less_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHB_cmpmix_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat<cc::split_list::stat<>>
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/michael_list_rcu.h>
-#include <cds/container/split_list_map_rcu.h>
-
-namespace map {
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::relaxed_ordering memory_model;
- enum { dynamic_bucket_table = false };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- };
- };
-
- struct RCU_SHT_less_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
- typedef cc::opt::v::sequential_consistent memory_model;
- enum { dynamic_bucket_table = true };
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::less less;
- };
- };
-
- struct RCU_cmpmix_traits: public cc::split_list::traits
- {
- typedef cc::michael_list_tag ordered_list;
- typedef HashMapHdrTest::hash_int hash;
- typedef HashMapHdrTest::simple_item_counter item_counter;
-
- struct ordered_list_traits: public cc::michael_list::traits
- {
- typedef HashMapHdrTest::cmp compare;
- typedef std::less<HashMapHdrTest::key_type> less;
- };
- };
-
- struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
- {
- typedef cc::split_list::stat<> stat;
- };
- }
-#endif
-
- void HashMapHdrTest::Split_RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< true >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_less_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
- ,cc::split_list::dynamic_bucket_table< false >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< less >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
- void HashMapHdrTest::Split_RCU_SHT_cmpmix_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
- test_rcu_split_list< map_type >();
-
- // option-based version
- typedef cc::SplitListMap< rcu_type,
- key_type,
- value_type,
- cc::split_list::make_traits<
- cc::split_list::ordered_list<cc::michael_list_tag>
- ,cc::opt::hash< hash_int >
- ,cc::opt::item_counter< simple_item_counter >
- ,cc::opt::stat<cc::split_list::stat<>>
- ,cc::split_list::ordered_list_traits<
- cc::michael_list::make_traits<
- cc::opt::less< std::less<key_type> >
- ,cc::opt::compare< cmp >
- >::type
- >
- >::type
- > opt_map;
- test_rcu_split_list< opt_map >();
-#endif
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Striped_boost_flat_map()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_map you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_flat_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::flat_map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Striped_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
-
- }
-
-} // namespace map
-
-/*
-#else
- namespace map {
- void StripedMapHdrTest::Striped_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "Skipped; to use boost::container::flat_map is not compatible with MS VC++ 11" );
- }
- }
-#endif
-*/
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Striped_boost_flat_map()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Striped_boost_list()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::list you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_list.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::list< StripedMapHdrTest::pair_type > sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second ));
- }
- };
- }
-
- void StripedMapHdrTest::Striped_boost_list()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
-
- }
-
-} // namespace map
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Striped_boost_list()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::list you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Striped_boost_map()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::map you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& map, iterator itWhat )
- {
- map.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Striped_boost_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
- }
-
-} // namespace map
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Striped_boost_map()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::map you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/boost_unordered_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( std::make_pair(itWhat->first, itWhat->second ) );
- }
- };
- }
-
- void StripedMapHdrTest::Striped_boost_unordered_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_hash_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( std::make_pair(itWhat->first, itWhat->second ) );
- }
- };
- }
-
- void StripedMapHdrTest::Striped_hashmap()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_list.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::list<StripedMapHdrTest::pair_type> sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second ));
- }
-
- };
- }
-
- void StripedMapHdrTest::Striped_list()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-#include <cds/container/striped_map/std_map.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef std::map<StripedMapHdrTest::key_type, StripedMapHdrTest::value_type, StripedMapHdrTest::less > map_t;
-
- struct my_copy_policy {
- typedef map_t::iterator iterator;
-
- void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat )
- {
- m.insert( *itWhat );
- }
- };
- }
-
- void StripedMapHdrTest::Striped_map()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > map_less_resizing_lf;
- map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- > map_less_resizing_lf16;
- test_striped< map_less_resizing_lf16 >();
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)");
- {
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> >
- > map_less_resizing_sbt16;
- test_striped< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped< set_copy_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped< set_swap_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped< set_move_item >();
-
- CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy");
- typedef cc::StripedMap< map_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<256> >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped< set_special_copy_item >();
- }
-
-} // namespace map
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-#include <boost/version.hpp>
-#include <cds/details/defs.h>
-#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500
-namespace map {
- void StripedMapHdrTest::Striped_slist()
- {
- CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::slist you should use boost version 1.56 or above");
- }
-}
-
-#elif BOOST_VERSION >= 104800
-
-#include <cds/container/striped_map/boost_slist.h>
-#include <cds/container/striped_map.h>
-#include <cds/sync/spinlock.h>
-
-namespace map {
-
- namespace {
- typedef boost::container::slist<StripedMapHdrTest::pair_type> sequence_t;
-
- struct my_copy_policy {
- typedef sequence_t::iterator iterator;
-
- void operator()( sequence_t& list, iterator itInsert, iterator itWhat )
- {
- list.insert_after( itInsert, StripedMapHdrTest::pair_type( std::make_pair(itWhat->first, itWhat->second )));
- }
- };
- }
-
- void StripedMapHdrTest::Striped_slist()
- {
- CPPUNIT_MESSAGE( "cmp");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- ,co::mutex_policy< cc::striped_set::striping<> >
- > map_cmp;
- test_striped2< map_cmp >();
-
- CPPUNIT_MESSAGE( "less");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- > map_less;
- test_striped2< map_less >();
-
- CPPUNIT_MESSAGE( "cmpmix");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::less< less >
- > map_cmpmix;
- test_striped2< map_cmpmix >();
-
- // Spinlock as lock policy
- CPPUNIT_MESSAGE( "spinlock");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::mutex_policy< cc::striped_set::striping<cds::sync::spin> >
- > map_spin;
- test_striped2< map_spin >();
-
- // Resizing policy
- CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)");
- {
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<0> >
- > pair_type_less_resizing_lf;
- pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) );
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "load_factor_resizing<4>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::load_factor_resizing<4> >
- > map_less_resizing_lf16;
- test_striped2< map_less_resizing_lf16 >();
-
- {
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> >
- > map_less_resizing_sbt;
- map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8));
- test_striped_with(m);
- }
-
- CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> >
- > map_less_resizing_sbt16;
- test_striped2< map_less_resizing_sbt16 >();
-
- // Copy policy
- CPPUNIT_MESSAGE( "copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::copy_item >
- > set_copy_item;
- test_striped2< set_copy_item >();
-
- CPPUNIT_MESSAGE( "swap_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::swap_item >
- > set_swap_item;
- test_striped2< set_swap_item >();
-
- CPPUNIT_MESSAGE( "move_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::less< less >
- , co::copy_policy< cc::striped_set::move_item >
- > set_move_item;
- test_striped2< set_move_item >();
-
- CPPUNIT_MESSAGE( "special copy_item");
- typedef cc::StripedMap< sequence_t
- , co::hash< hash_int >
- , co::compare< cmp >
- , co::copy_policy< my_copy_policy >
- > set_special_copy_item;
- test_striped2< set_special_copy_item >();
- }
-
-} // namespace map
-
-#else // BOOST_VERSION < 104800
-
-namespace map {
- void StripedMapHdrTest::Striped_slist()
- {
- CPPUNIT_MESSAGE( "Skipped; for boost::container::slist you should use boost version 1.48 or above" );
- }
-}
-#endif // BOOST_VERSION
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_STRIPED_MAP_H
-#define CDSTEST_HDR_STRIPED_MAP_H
-#include "size_check.h"
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/os/timer.h>
-#include <cds/opt/hash.h>
-#include <functional> // ref
-
-namespace cds { namespace container {}}
-
-namespace map {
- using misc::check_size;
-
- namespace cc = cds::container;
- namespace co = cds::opt;
-
- class StripedMapHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct value_type {
- int m_val;
-
- value_type()
- : m_val(0)
- {}
-
- value_type( int n )
- : m_val( n )
- {}
-
- value_type( value_type&& v )
- : m_val( v.m_val )
- {}
-
- value_type( value_type const& v )
- : m_val( v.m_val )
- {}
-
- value_type& operator=( value_type const& v )
- {
- m_val = v.m_val;
- return *this;
- }
- };
-
- typedef std::pair<key_type const, value_type> pair_type;
-
- struct less
- {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 < v2;
- }
- };
-
- struct cmp {
- int operator ()(int v1, int v2 ) const
- {
- if ( v1 < v2 )
- return -1;
- return v1 > v2 ? 1 : 0;
- }
- };
-
- struct equal {
- bool operator ()(int v1, int v2 ) const
- {
- return v1 == v2;
- }
- };
-
- struct hash_int {
- size_t operator()( int i ) const
- {
- return co::v::hash<int>()( i );
- }
- };
-
- struct simple_item_counter {
- size_t m_nCount;
-
- simple_item_counter()
- : m_nCount(0)
- {}
-
- size_t operator ++()
- {
- return ++m_nCount;
- }
-
- size_t operator --()
- {
- return --m_nCount;
- }
-
- void reset()
- {
- m_nCount = 0;
- }
-
- operator size_t() const
- {
- return m_nCount;
- }
- };
-
- template <typename Map>
- struct insert_functor
- {
- typedef typename Map::value_type pair_type;
-
- // insert ftor
- void operator()( pair_type& item )
- {
- item.second.m_val = item.first * 3;
- }
-
- // update() ftor
- void operator()( bool bNew, pair_type& item )
- {
- if ( bNew )
- item.second.m_val = item.first * 2;
- else
- item.second.m_val = item.first * 5;
- }
- };
-
- struct check_value {
- int m_nExpected;
-
- check_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- template <typename T>
- void operator ()( T& pair )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- template <typename T, typename Q>
- void operator ()( T& pair, Q )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- };
-
- struct extract_functor
- {
- int * m_pVal;
- void operator()( pair_type const& val )
- {
- *m_pVal = val.second.m_val;
- }
- };
-
- template <class Map>
- void test_int_with( Map& m )
- {
- std::pair<bool, bool> updateResult;
-
- // insert
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(25) );
-
- CPPUNIT_ASSERT( !m.insert( 25 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
-
- CPPUNIT_ASSERT( !m.contains(10) );
- CPPUNIT_ASSERT( m.insert( 10, 10 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(10) );
-
- CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
-
- CPPUNIT_ASSERT( !m.contains(30) );
- CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(30) );
-
- CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
-
- // update() (new key)
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update(27, insert_functor<Map>(), false);
- CPPUNIT_ASSERT(!updateResult.first);
- CPPUNIT_ASSERT(!updateResult.second);
- CPPUNIT_ASSERT(check_size(m, 3));
- CPPUNIT_ASSERT(!m.contains(27));
- updateResult = m.update( 27, insert_functor<Map>() ) ; // value = 54
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(27) );
-
- // find test
- check_value chk(10);
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 25, std::ref( chk ) ) );
- chk.m_nExpected = 90;
- CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
- chk.m_nExpected = 54;
- CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
-
- updateResult = m.update( 10, insert_functor<Map>() ) ; // value = 50
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- chk.m_nExpected = 50;
- CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !m.contains(100) );
- CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
-
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 25 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( !m.erase( 25 ));
-
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( m.insert(258))
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(258) );
- CPPUNIT_ASSERT( m.erase( 258 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( !m.erase( 258 ));
-
- int nVal;
- extract_functor ext;
- ext.m_pVal = &nVal;
-
- CPPUNIT_ASSERT( !m.contains(29) );
- CPPUNIT_ASSERT( m.insert(29, 290));
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 29, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( nVal == 290 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 29, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( nVal == 90 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
- CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
- CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
-
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- chk.m_nExpected = 731;
- CPPUNIT_ASSERT( m.find( 137, std::ref(chk) ));
- chk.m_nExpected = 941;
- CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
-
- CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- template <class Map>
- void test_iter( Map& s)
- {
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
-
- const int nMaxCount = 500;
- for ( int i = 0; i < nMaxCount; ++i ) {
- CPPUNIT_ASSERT( s.insert( i, i * 2 ));
- }
-
- int nCount = 0;
- for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first * 2 == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val );
- it->second.m_val = it->first;
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
-
- Map const& refSet = s;
- nCount = 0;
- for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
- CPPUNIT_ASSERT( it->first == it->second.m_val );
- CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
- ++nCount;
- }
- CPPUNIT_ASSERT( nCount == nMaxCount );
- }
-
- template <class Map>
- void test_striped()
- {
- Map m( 30 );
- CPPUNIT_ASSERT( m.bucket_count() == 32 );
- CPPUNIT_ASSERT( m.lock_count() == 32 );
-
- test_striped_with(m);
- }
-
- template <class Map>
- void test_striped_with(Map& m)
- {
- cds::OS::Timer timer;
-
- test_int_with( m );
-
- // Iterators is not yet supported
- //m.clear();
- //CPPUNIT_ASSERT( m.empty() );
- //CPPUNIT_ASSERT( check_size( m, 0 ));
- //test_iter(m);
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // Resizing test
- for ( int i = 0; i < 40000; i++ ) {
- m.insert( i );
- }
-
- CPPUNIT_MSG( " Duration=" << timer.duration() );
- }
-
- //*******************************************
- // If erase_with && find_with are supported
- template <class Map>
- void test_int_with2( Map& m )
- {
- std::pair<bool, bool> updateResult;
-
- // insert
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(25) );
-
- CPPUNIT_ASSERT( !m.insert( 25 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
-
- CPPUNIT_ASSERT( !m.contains(10, less()) );
- CPPUNIT_ASSERT( m.insert( 10, 10 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(10, less()) );
-
- CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
-
- CPPUNIT_ASSERT( !m.contains(30) );
- CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(30) );
-
- CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
-
- // update() (new key)
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update(27, insert_functor<Map>(), false);
- CPPUNIT_ASSERT(!updateResult.first);
- CPPUNIT_ASSERT(!updateResult.second);
- CPPUNIT_ASSERT(!m.contains(27));
- updateResult = m.update( 27, insert_functor<Map>() ) ; // value = 54
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( m.contains(27) );
-
- // find test
- check_value chk(10);
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
- chk.m_nExpected = 90;
- CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
- chk.m_nExpected = 54;
- CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
-
- updateResult = m.update( 10, insert_functor<Map>(), false ) ; // value = 50
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- chk.m_nExpected = 50;
- CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !m.contains(100) );
- CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
-
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 25 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( !m.erase( 25 ));
-
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( m.insert(258))
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(258, less()) );
- CPPUNIT_ASSERT( m.erase_with( 258, less() ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( !m.erase_with( 258, less() ));
-
- int nVal;
- extract_functor ext;
- ext.m_pVal = &nVal;
-
- CPPUNIT_ASSERT( !m.contains(29) );
- CPPUNIT_ASSERT( m.insert(29, 290))
- CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( nVal == 290 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( nVal == 90 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
- CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
- CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
-
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- chk.m_nExpected = 731;
- CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
- chk.m_nExpected = 941;
- CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
-
- CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- template <class Map>
- void test_striped_with2(Map& m)
- {
- cds::OS::Timer timer;
-
- test_int_with2( m );
-
- // Iterators is not yet supported
- //m.clear();
- //CPPUNIT_ASSERT( m.empty() );
- //CPPUNIT_ASSERT( check_size( m, 0 ));
- //test_iter(m);
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // Resizing test
- for ( int i = 0; i < 40000; i++ ) {
- m.insert( i );
- }
-
- CPPUNIT_MSG( " Duration=" << timer.duration() );
- }
-
- template <class Map>
- void test_striped2()
- {
- Map m( 30 );
- CPPUNIT_ASSERT( m.bucket_count() == 32 );
- CPPUNIT_ASSERT( m.lock_count() == 32 );
-
- test_striped_with2(m);
- }
-
- void Striped_hashmap();
- void Striped_list();
- void Striped_map();
- void Striped_slist();
- void Striped_boost_list();
- void Striped_boost_flat_map();
- void Striped_boost_map();
- void Striped_boost_unordered_map();
-
- void Refinable_hashmap();
- void Refinable_list();
- void Refinable_map();
- void Refinable_slist();
- void Refinable_boost_list();
- void Refinable_boost_flat_map();
- void Refinable_boost_map();
- void Refinable_boost_unordered_map();
-
- CPPUNIT_TEST_SUITE(StripedMapHdrTest)
- CPPUNIT_TEST(Striped_hashmap)
- CPPUNIT_TEST(Striped_list)
- CPPUNIT_TEST(Striped_map)
- CPPUNIT_TEST(Striped_slist)
- CPPUNIT_TEST(Striped_boost_list)
- CPPUNIT_TEST(Striped_boost_flat_map)
- CPPUNIT_TEST(Striped_boost_map)
- CPPUNIT_TEST(Striped_boost_unordered_map)
-
- CPPUNIT_TEST(Refinable_hashmap)
- CPPUNIT_TEST(Refinable_list)
- CPPUNIT_TEST(Refinable_map)
- CPPUNIT_TEST(Refinable_slist)
- CPPUNIT_TEST(Refinable_boost_list)
- CPPUNIT_TEST(Refinable_boost_flat_map)
- CPPUNIT_TEST(Refinable_boost_map)
- CPPUNIT_TEST(Refinable_boost_unordered_map)
- CPPUNIT_TEST_SUITE_END()
-
- };
-} // namespace map
-
-#endif // #ifndef CDSTEST_HDR_STRIPED_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "map/hdr_striped_map.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION(map::StripedMapHdrTest);
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H
-#define CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H
-
-#include "unit/print_skip_list_stat.h"
-
-namespace misc {
-
- template <typename Stat>
- struct print_skiplist_stat;
-
- template <>
- struct print_skiplist_stat< cds::intrusive::skip_list::stat<> >
- {
- template <class Set>
- std::string operator()( Set const& s, const char * pszHdr )
- {
- std::stringstream st;
- if ( pszHdr ) {
- st << "\t\t" << pszHdr << "\n"
- << s.statistics();
- }
- else {
- st << s.statistics();
- }
- return st.str();
- }
- };
-
- template<>
- struct print_skiplist_stat< cds::intrusive::skip_list::empty_stat >
- {
- template <class Set>
- std::string operator()( Set const& /*s*/, const char * /*pszHdr*/ )
- {
- return std::string();
- }
- };
-
-} // namespace misc
-
-#endif // #ifndef CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H