--- /dev/null
+building liblfds
+================
+
+Windows (user-mode)
+===================
+1. Use Microsoft Visual Studio 2008 or Visual C++ 2008 Express Edition
+ to load "liblfds.sln".
+
+2. Use Microsoft Windows SDK and GNUmake to run makefile.windows (obviously
+ you'll need to have run the appropriate vcvars*.bat first; you can build
+ for both IA64, 64-bit and 32-bit - just run the correct vcvars batch file).
+
+ Targets are "librel", "libdbg", "dllrel", "dlldbg" and "clean". You need
+ to clean between switching targets.
+
+Windows (kernel)
+================
+Use the Windows Driver Kit "build" command. Prior to running "build",
+if you wish to build a static library, run the batch file
+"runme_before_win_kernel_static_lib_build.bat"; if you wish to
+build a dynamic library, instead run "runme_before_win_kernel_dynamic_lib_build.bat".
+
+The Windows kernel build system is rather limited and rather than
+really rather messing up the directory/file structure just for the
+Windows kernel platform, I've instead arranged it that these batch
+files do the necessary work so that "build" will work.
+
+The batch files are idempotent; you can run them as often as you
+like, in any order, at any time (before or after builds), and they'll
+do the right thing.
+
+Linux
+=====
+Use GNUmake to run "makefile.linux". Targets are "arrel", "ardbg",
+"sorel", "sodbg" and "clean". You need to clean between switching
+targets.
+
+
--- /dev/null
+DIRS = src
+
--- /dev/null
+#ifndef __LIBLFDS600_H
+
+ /***** library header *****/
+ #define LFDS600_RELEASE_NUMBER 1
+
+
+
+
+ /***** lfds600_abstraction *****/
+
+ /***** defines *****/
+ #if (defined _WIN64 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
+ // TRD : 64-bit Windows user-mode with the Microsoft C compiler, any CPU
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <windows.h>
+ #include <intrin.h>
+ typedef unsigned __int64 lfds600_atom_t;
+ #define LFDS600_INLINE extern __forceinline
+ #define LFDS600_ALIGN(alignment) __declspec( align(alignment) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 8
+ #define LFDS600_ALIGN_DOUBLE_POINTER 16
+ #endif
+
+ #if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
+ // TRD : 32-bit Windows user-mode with the Microsoft C compiler, any CPU
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <windows.h>
+ #include <intrin.h>
+ typedef unsigned long int lfds600_atom_t;
+ #define LFDS600_INLINE extern __forceinline
+ #define LFDS600_ALIGN(alignment) __declspec( align(alignment) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 4
+ #define LFDS600_ALIGN_DOUBLE_POINTER 8
+
+ // TRD : this define is documented but missing in Microsoft Platform SDK v7.0
+ #define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare)
+ #endif
+
+ #if (defined _WIN64 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
+ // TRD : 64-bit Windows kernel with the Microsoft C compiler, any CPU
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <wdm.h>
+ typedef unsigned __int64 lfds600_atom_t;
+ #define LFDS600_INLINE extern __forceinline
+ #define LFDS600_ALIGN(alignment) __declspec( align(alignment) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 8
+ #define LFDS600_ALIGN_DOUBLE_POINTER 16
+ #endif
+
+ #if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
+ // TRD : 32-bit Windows kernel with the Microsoft C compiler, any CPU
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <wdm.h>
+ typedef unsigned long int lfds600_atom_t;
+ #define LFDS600_INLINE extern __forceinline
+ #define LFDS600_ALIGN(alignment) __declspec( align(alignment) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 4
+ #define LFDS600_ALIGN_DOUBLE_POINTER 8
+
+ // TRD : this define is documented but missing in Microsoft Platform SDK v7.0
+ #define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare)
+ #endif
+
+ #if (defined __unix__ && defined __x86_64__ && __GNUC__)
+ // TRD : any UNIX with GCC on x64
+ #define _XOPEN_SOURCE 600
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ typedef unsigned long long int lfds600_atom_t;
+ #define LFDS600_INLINE inline
+ #define LFDS600_ALIGN(alignment) __attribute__( (aligned(alignment)) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 8
+ #define LFDS600_ALIGN_DOUBLE_POINTER 16
+ #endif
+
+ #if (defined __unix__ && defined __i686__ && __GNUC__)
+ // TRD : any UNIX with GCC on x86
+ #define _XOPEN_SOURCE 600
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ typedef unsigned long int lfds600_atom_t;
+ #define LFDS600_INLINE inline
+ #define LFDS600_ALIGN(alignment) __attribute__( (aligned(alignment)) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 4
+ #define LFDS600_ALIGN_DOUBLE_POINTER 8
+ #endif
+
+ #if (defined __unix__ && defined __arm__ && __GNUC__)
+ // TRD : any UNIX with GCC on ARM
+ #define _XOPEN_SOURCE 600
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ typedef unsigned long int lfds600_atom_t;
+ #define LFDS600_INLINE inline
+ #define LFDS600_ALIGN(alignment) __attribute__( (aligned(alignment)) )
+ #define LFDS600_ALIGN_SINGLE_POINTER 4
+ #define LFDS600_ALIGN_DOUBLE_POINTER 8
+ #endif
+
+ /***** enums *****/
+ enum data_structure_validity
+ {
+ VALIDITY_VALID,
+ VALIDITY_INVALID_LOOP,
+ VALIDITY_INVALID_MISSING_ELEMENTS,
+ VALIDITY_INVALID_ADDITIONAL_ELEMENTS,
+ VALIDITY_INVALID_TEST_DATA
+ };
+
+ /***** structs *****/
+ struct lfds600_validation_info
+ {
+ lfds600_atom_t
+ min_elements,
+ max_elements;
+ };
+
+ /***** public prototypes *****/
+ void lfds600_abstraction_aligned_free( void *memory );
+ void *lfds600_abstraction_aligned_malloc( size_t size, size_t align_in_bytes );
+ lfds600_atom_t lfds600_abstraction_cas( volatile lfds600_atom_t *destination, lfds600_atom_t exchange, lfds600_atom_t compare );
+ unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare );
+ lfds600_atom_t lfds600_abstraction_increment( lfds600_atom_t *value );
+
+
+
+
+
+ /***** lfds600_freelist *****/
+
+ /***** enums *****/
+ enum lfds600_freelist_query_type
+ {
+ LFDS600_FREELIST_QUERY_ELEMENT_COUNT,
+ LFDS600_FREELIST_QUERY_VALIDATE
+ };
+
+ /***** incomplete types *****/
+ struct lfds600_freelist_state;
+ struct lfds600_freelist_element;
+
+ /***** public prototypes *****/
+ int lfds600_freelist_new( struct lfds600_freelist_state **fs, lfds600_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state );
+ void lfds600_freelist_delete( struct lfds600_freelist_state *fs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
+
+ lfds600_atom_t lfds600_freelist_new_elements( struct lfds600_freelist_state *fs, lfds600_atom_t number_elements );
+
+ struct lfds600_freelist_element *lfds600_freelist_pop( struct lfds600_freelist_state *fs, struct lfds600_freelist_element **fe );
+ struct lfds600_freelist_element *lfds600_freelist_guaranteed_pop( struct lfds600_freelist_state *fs, struct lfds600_freelist_element **fe );
+ void lfds600_freelist_push( struct lfds600_freelist_state *fs, struct lfds600_freelist_element *fe );
+
+ void *lfds600_freelist_get_user_data_from_element( struct lfds600_freelist_element *fe, void **user_data );
+ void lfds600_freelist_set_user_data_in_element( struct lfds600_freelist_element *fe, void *user_data );
+
+ void lfds600_freelist_query( struct lfds600_freelist_state *fs, enum lfds600_freelist_query_type query_type, void *query_input, void *query_output );
+
+
+
+
+
+ /***** lfds600_queue *****/
+
+ /***** enums *****/
+ enum lfds600_queue_query_type
+ {
+ LFDS600_QUEUE_QUERY_ELEMENT_COUNT,
+ LFDS600_QUEUE_QUERY_VALIDATE
+ };
+
+ /***** incomplete types *****/
+ struct lfds600_queue_state;
+
+ /***** public prototypes *****/
+ int lfds600_queue_new( struct lfds600_queue_state **sq, lfds600_atom_t number_elements );
+ void lfds600_queue_delete( struct lfds600_queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
+
+ int lfds600_queue_enqueue( struct lfds600_queue_state *qs, void *user_data );
+ int lfds600_queue_guaranteed_enqueue( struct lfds600_queue_state *qs, void *user_data );
+ int lfds600_queue_dequeue( struct lfds600_queue_state *qs, void **user_data );
+
+ void lfds600_queue_query( struct lfds600_queue_state *qs, enum lfds600_queue_query_type query_type, void *query_input, void *query_output );
+
+
+
+
+
+ /***** lfds600_ringbuffer *****/
+
+ /***** enums *****/
+ enum lfds600_ringbuffer_query_type
+ {
+ LFDS600_RINGBUFFER_QUERY_VALIDATE
+ };
+
+ /***** incomplete types *****/
+ struct lfds600_ringbuffer_state;
+
+ /***** public prototypes *****/
+ int lfds600_ringbuffer_new( struct lfds600_ringbuffer_state **rs, lfds600_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state );
+ void lfds600_ringbuffer_delete( struct lfds600_ringbuffer_state *rs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
+
+ struct lfds600_freelist_element *lfds600_ringbuffer_get_read_element( struct lfds600_ringbuffer_state *rs, struct lfds600_freelist_element **fe );
+ struct lfds600_freelist_element *lfds600_ringbuffer_get_write_element( struct lfds600_ringbuffer_state *rs, struct lfds600_freelist_element **fe, int *overwrite_flag );
+
+ void lfds600_ringbuffer_put_read_element( struct lfds600_ringbuffer_state *rs, struct lfds600_freelist_element *fe );
+ void lfds600_ringbuffer_put_write_element( struct lfds600_ringbuffer_state *rs, struct lfds600_freelist_element *fe );
+
+ void lfds600_ringbuffer_query( struct lfds600_ringbuffer_state *rs, enum lfds600_ringbuffer_query_type query_type, void *query_input, void *query_output );
+
+
+
+
+
+ /***** lfds600_slist *****/
+
+ /***** incomplete types *****/
+ struct lfds600_slist_state;
+ struct lfds600_slist_element;
+
+ /***** public prototypes *****/
+ int lfds600_slist_new( struct lfds600_slist_state **ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
+ void lfds600_slist_delete( struct lfds600_slist_state *ss );
+
+ struct lfds600_slist_element *lfds600_slist_new_head( struct lfds600_slist_state *ss, void *user_data );
+ struct lfds600_slist_element *lfds600_slist_new_next( struct lfds600_slist_element *se, void *user_data );
+
+ void lfds600_slist_delete_element( struct lfds600_slist_state *ss, struct lfds600_slist_element *se );
+ void lfds600_slist_delete_all_elements( struct lfds600_slist_state *ss );
+
+ int lfds600_slist_get_user_data_from_element( struct lfds600_slist_element *se, void **user_data );
+ int lfds600_slist_set_user_data_in_element( struct lfds600_slist_element *se, void *user_data );
+
+ struct lfds600_slist_element *lfds600_slist_get_head( struct lfds600_slist_state *ss, struct lfds600_slist_element **se );
+ struct lfds600_slist_element *lfds600_slist_get_next( struct lfds600_slist_element *se, struct lfds600_slist_element **next_se );
+ struct lfds600_slist_element *lfds600_slist_get_head_and_then_next( struct lfds600_slist_state *ss, struct lfds600_slist_element **se );
+
+
+
+
+
+ /***** lfds600_stack *****/
+
+ /***** enums *****/
+ enum lfds600_stack_query_type
+ {
+ LFDS600_STACK_QUERY_ELEMENT_COUNT
+ };
+
+ /***** incomplete types *****/
+ struct lfds600_stack_state;
+
+ /***** public prototypes *****/
+ int lfds600_stack_new( struct lfds600_stack_state **ss, lfds600_atom_t number_elements );
+ void lfds600_stack_delete( struct lfds600_stack_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
+
+ void lfds600_stack_clear( struct lfds600_stack_state *ss, void (*user_data_clear_function)(void *user_data, void *user_state), void *user_state );
+
+ int lfds600_stack_push( struct lfds600_stack_state *ss, void *user_data );
+ int lfds600_stack_guaranteed_push( struct lfds600_stack_state *ss, void *user_data );
+ int lfds600_stack_pop( struct lfds600_stack_state *ss, void **user_data );
+
+ void lfds600_stack_query( struct lfds600_stack_state *ss, enum lfds600_stack_query_type query_type, void *query_input, void *query_output );
+
+
+
+
+
+ #define __LIBLFDS600_H
+
+#endif
+
--- /dev/null
+EXPORTS
+
+lfds600_freelist_delete = lfds600_freelist_delete @1
+lfds600_freelist_get_user_data_from_element = lfds600_freelist_get_user_data_from_element @2
+lfds600_freelist_guaranteed_pop = lfds600_freelist_guaranteed_pop @3
+lfds600_freelist_new = lfds600_freelist_new @4
+lfds600_freelist_new_elements = lfds600_freelist_new_elements @5
+lfds600_freelist_pop = lfds600_freelist_pop @6
+lfds600_freelist_push = lfds600_freelist_push @7
+lfds600_freelist_query = lfds600_freelist_query @8
+lfds600_freelist_set_user_data_in_element = lfds600_freelist_set_user_data_in_element @9
+
+lfds600_queue_delete = lfds600_queue_delete @10
+lfds600_queue_dequeue = lfds600_queue_dequeue @11
+lfds600_queue_enqueue = lfds600_queue_enqueue @12
+lfds600_queue_guaranteed_enqueue = lfds600_queue_guaranteed_enqueue @13
+lfds600_queue_new = lfds600_queue_new @14
+lfds600_queue_query = lfds600_queue_query @15
+
+lfds600_ringbuffer_delete = lfds600_ringbuffer_delete @16
+lfds600_ringbuffer_get_read_element = lfds600_ringbuffer_get_read_element @17
+lfds600_ringbuffer_get_write_element = lfds600_ringbuffer_get_write_element @18
+lfds600_ringbuffer_new = lfds600_ringbuffer_new @19
+lfds600_ringbuffer_put_read_element = lfds600_ringbuffer_put_read_element @20
+lfds600_ringbuffer_put_write_element = lfds600_ringbuffer_put_write_element @21
+
+lfds600_slist_delete = lfds600_slist_delete @ 22
+lfds600_slist_delete_all_elements = lfds600_slist_delete_all_elements @ 23
+lfds600_slist_delete_element = lfds600_slist_delete_element @ 24
+lfds600_slist_get_head = lfds600_slist_get_head @ 25
+lfds600_slist_get_head_and_then_next = lfds600_slist_get_head_and_then_next @ 26
+lfds600_slist_get_next = lfds600_slist_get_next @ 27
+lfds600_slist_get_user_data_from_element = lfds600_slist_get_user_data_from_element @ 28
+lfds600_slist_new = lfds600_slist_new @ 29
+lfds600_slist_new_head = lfds600_slist_new_head @ 30
+lfds600_slist_new_next = lfds600_slist_new_next @ 31
+lfds600_slist_set_user_data_in_element = lfds600_slist_set_user_data_in_element @ 32
+
+lfds600_stack_clear = lfds600_stack_clear @33
+lfds600_stack_delete = lfds600_stack_delete @34
+lfds600_stack_guaranteed_push = lfds600_stack_guaranteed_push @35
+lfds600_stack_new = lfds600_stack_new @36
+lfds600_stack_pop = lfds600_stack_pop @37
+lfds600_stack_push = lfds600_stack_push @38
+lfds600_stack_query = lfds600_stack_query @39
+
--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 10.00\r
+# Visual Studio 2008\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds600", "liblfds600.vcproj", "{F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug DLL|Win32 = Debug DLL|Win32\r
+ Debug DLL|x64 = Debug DLL|x64\r
+ Debug Lib|Win32 = Debug Lib|Win32\r
+ Debug Lib|x64 = Debug Lib|x64\r
+ Release DLL|Win32 = Release DLL|Win32\r
+ Release DLL|x64 = Release DLL|x64\r
+ Release Lib|Win32 = Release Lib|Win32\r
+ Release Lib|x64 = Release Lib|x64\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.Build.0 = Debug DLL|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.ActiveCfg = Debug DLL|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.Build.0 = Debug DLL|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.ActiveCfg = Debug Lib|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.Build.0 = Debug Lib|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.ActiveCfg = Debug Lib|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.Build.0 = Debug Lib|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.ActiveCfg = Release DLL|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.Build.0 = Release DLL|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.ActiveCfg = Release DLL|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.Build.0 = Release DLL|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.ActiveCfg = Release Lib|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.Build.0 = Release Lib|Win32\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.ActiveCfg = Release Lib|x64\r
+ {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.Build.0 = Release Lib|x64\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="liblfds600"\r
+ ProjectGUID="{F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}"\r
+ RootNamespace="liblfds"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug Lib|Win32"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /D_DEBUG"\r
+ Optimization="0"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ MinimalRebuild="true"\r
+ ExceptionHandling="0"\r
+ BasicRuntimeChecks="3"\r
+ EnableFunctionLevelLinking="true"\r
+ BrowseInformation="1"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/wx"\r
+ AdditionalLibraryDirectories=""\r
+ IgnoreAllDefaultLibraries="true"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug Lib|x64"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /D_DEBUG"\r
+ Optimization="0"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ ExceptionHandling="0"\r
+ BasicRuntimeChecks="3"\r
+ SmallerTypeCheck="true"\r
+ EnableFunctionLevelLinking="true"\r
+ BrowseInformation="1"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/wx"\r
+ AdditionalLibraryDirectories=""\r
+ IgnoreAllDefaultLibraries="true"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release Lib|Win32"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /DNDEBUG"\r
+ Optimization="3"\r
+ EnableIntrinsicFunctions="true"\r
+ FavorSizeOrSpeed="1"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ StringPooling="true"\r
+ ExceptionHandling="0"\r
+ BufferSecurityCheck="false"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="0"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/wx"\r
+ AdditionalLibraryDirectories=""\r
+ IgnoreAllDefaultLibraries="true"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release Lib|x64"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="4"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /DNDEBUG"\r
+ Optimization="3"\r
+ EnableIntrinsicFunctions="true"\r
+ FavorSizeOrSpeed="1"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ StringPooling="true"\r
+ ExceptionHandling="0"\r
+ BufferSecurityCheck="false"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="0"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ AdditionalOptions="/wx"\r
+ AdditionalLibraryDirectories=""\r
+ IgnoreAllDefaultLibraries="true"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug DLL|Win32"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /D_DEBUG"\r
+ Optimization="0"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ MinimalRebuild="true"\r
+ ExceptionHandling="0"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ EnableFunctionLevelLinking="true"\r
+ BrowseInformation="1"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="msvcrtd.lib"\r
+ IgnoreAllDefaultLibraries="true"\r
+ ModuleDefinitionFile="$(ProjectDir)\liblfds600.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug DLL|x64"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /D_DEBUG"\r
+ Optimization="0"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ ExceptionHandling="0"\r
+ BasicRuntimeChecks="3"\r
+ SmallerTypeCheck="true"\r
+ RuntimeLibrary="3"\r
+ EnableFunctionLevelLinking="true"\r
+ BrowseInformation="1"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="msvcrtd.lib"\r
+ IgnoreAllDefaultLibraries="true"\r
+ ModuleDefinitionFile="$(ProjectDir)\liblfds600.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release DLL|Win32"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /DNDEBUG"\r
+ Optimization="3"\r
+ EnableIntrinsicFunctions="true"\r
+ FavorSizeOrSpeed="1"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ StringPooling="true"\r
+ ExceptionHandling="0"\r
+ RuntimeLibrary="2"\r
+ BufferSecurityCheck="false"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="0"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="msvcrt.lib"\r
+ IgnoreAllDefaultLibraries="true"\r
+ ModuleDefinitionFile="$(ProjectDir)\liblfds600.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release DLL|x64"\r
+ OutputDirectory="$(ProjectDir)\bin\$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ProjectDir)\obj\$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="0"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalOptions="/DWIN32_LEAN_AND_MEAN /DNDEBUG"\r
+ Optimization="3"\r
+ EnableIntrinsicFunctions="true"\r
+ FavorSizeOrSpeed="1"\r
+ AdditionalIncludeDirectories=""$(ProjectDir)\src";"$(ProjectDir)\inc""\r
+ StringPooling="true"\r
+ ExceptionHandling="0"\r
+ RuntimeLibrary="2"\r
+ BufferSecurityCheck="false"\r
+ EnableFunctionLevelLinking="true"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="0"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="msvcrt.lib"\r
+ IgnoreAllDefaultLibraries="true"\r
+ ModuleDefinitionFile="$(ProjectDir)\liblfds600.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="inc"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\inc\abstraction.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\inc\freelist.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\inc\liblfds600.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\inc\queue.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\inc\ringbuffer.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\inc\stack.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="src"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_internal.h"\r
+ >\r
+ </File>\r
+ <Filter\r
+ Name="lfds600_abstraction"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_aligned_free.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_aligned_malloc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_cas.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_dcas.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_increment.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_abstraction\lfds600_abstraction_internal.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="lfds600_freelist"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_delete.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_get_and_set.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_new.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_pop_push.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_freelist\lfds600_freelist_query.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="lfds600_queue"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_queue\lfds600_queue_delete.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_queue\lfds600_queue_internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_queue\lfds600_queue_new.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_queue\lfds600_queue_query.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_queue\lfds600_queue_queue.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="lfds600_ringbuffer"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_ringbuffer\lfds600_ringbuffer_delete.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_ringbuffer\lfds600_ringbuffer_get_and_put.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_ringbuffer\lfds600_ringbuffer_internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_ringbuffer\lfds600_ringbuffer_new.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_ringbuffer\lfds600_ringbuffer_query.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="lfds600_slist"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_slist\lfds600_slist_delete.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_slist\lfds600_slist_get_and_set.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_slist\lfds600_slist_internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_slist\lfds600_slist_link.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_slist\lfds600_slist_new.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="lfds600_stack"\r
+ >\r
+ <File\r
+ RelativePath=".\src\lfds600_stack\lfds600_stack_delete.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_stack\lfds600_stack_internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_stack\lfds600_stack_new.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_stack\lfds600_stack_push_pop.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\src\lfds600_stack\lfds600_stack_query.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+##### paths #####
+BINDIR = bin
+INCDIR = inc
+OBJDIR = obj
+SRCDIR = src
+
+##### misc #####
+QUIETLY = 1>/dev/null 2>/dev/null
+
+##### sources, objects and libraries #####
+BINNAME = liblfds600
+AR_BINARY = $(BINDIR)/$(BINNAME).a
+SO_BINARY = $(BINDIR)/$(BINNAME).so
+SRCDIRS = lfds600_abstraction lfds600_freelist lfds600_queue lfds600_ringbuffer lfds600_slist lfds600_stack
+# TRD : be aware - in the linux makefile, with the one-pass linking behaviour of the GNU linker, the order
+# of source files matters! this is because it leads to the ordering of objects in the library and
+# that in turn, since the data structures all use the freelist API and the abstraction API, has to be
+# correct
+SOURCES = lfds600_queue_delete.c lfds600_queue_new.c lfds600_queue_query.c lfds600_queue_queue.c \
+ lfds600_ringbuffer_delete.c lfds600_ringbuffer_get_and_put.c lfds600_ringbuffer_new.c lfds600_ringbuffer_query.c \
+ lfds600_slist_delete.c lfds600_slist_get_and_set.c lfds600_slist_link.c lfds600_slist_new.c \
+ lfds600_stack_delete.c lfds600_stack_new.c lfds600_stack_push_pop.c lfds600_stack_query.c \
+ lfds600_freelist_delete.c lfds600_freelist_get_and_set.c lfds600_freelist_new.c lfds600_freelist_query.c lfds600_freelist_pop_push.c \
+ lfds600_abstraction_aligned_free.c lfds600_abstraction_aligned_malloc.c lfds600_abstraction_cas.c lfds600_abstraction_dcas.c lfds600_abstraction_increment.c
+OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
+
+##### CPU variants #####
+GCCARCH = $(shell uname -m)
+
+ifeq ($(GCCARCH),x86_64)
+ GCCARCH = core2
+endif
+
+ifeq ($(findstring arm,$(GCCARCH)),arm)
+ GCCARCH = armv6k
+endif
+
+##### tools #####
+MAKE = make
+MFLAGS =
+
+DG = gcc
+DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
+
+CC = gcc
+CBASE = -Wall -Wno-unknown-pragmas -std=c99 -march=$(GCCARCH) -c -I"$(SRCDIR)" -I"$(INCDIR)"
+CFREL = -O2 -finline-functions -Wno-strict-aliasing
+CFDBG = -O0 -g
+
+AR = ar
+AFLAGS = -rcs
+
+LD = gcc
+LFBASE = -Wall -std=c99 -shared
+LFREL = -O2 -s
+LFDBG = -O0 -g
+
+##### rel/dbg .a/.so variants #####
+ifeq ($(findstring so,$(MAKECMDGOALS)),so)
+ CBASE := $(CBASE) -fpic
+endif
+
+CFLAGS = $(CBASE) $(CFDBG)
+LFLAGS = $(LFBASE) $(LFDBG)
+
+ifeq ($(findstring rel,$(MAKECMDGOALS)),rel)
+ CFLAGS = $(CBASE) $(CFREL)
+ LFLAGS = $(LFBASE) $(LFREL)
+endif
+
+##### search paths #####
+vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
+
+##### implicit rules #####
+$(OBJDIR)/%.o : %.c
+ $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
+ $(CC) $(CFLAGS) -o $@ $<
+
+##### explicit rules #####
+$(AR_BINARY) : $(OBJECTS)
+ $(AR) $(AFLAGS) $(AR_BINARY) $(OBJECTS)
+
+$(SO_BINARY) : $(OBJECTS)
+ $(LD) $(LFLAGS) $(SYSLIBS) $(OBJECTS) -o $(SO_BINARY)
+
+##### phony #####
+.PHONY : clean arrel ardbg sorel sodbg
+
+clean :
+ @rm -f $(BINDIR)/$(BINNAME).* $(OBJDIR)/*.o $(OBJDIR)/*.d
+
+arrel : $(AR_BINARY)
+ardbg : $(AR_BINARY)
+
+sorel : $(SO_BINARY)
+sodbg : $(SO_BINARY)
+
+##### dependencies #####
+-include $(DEPENDS)
+
+##### notes #####
+# TRD : we use -std=c99 purely to permit C++ style comments
+
--- /dev/null
+##### paths #####
+BINDIR = bin
+INCDIR = inc
+OBJDIR = obj
+SRCDIR = src
+
+##### misc #####
+QUIETLY = 1>nul 2>nul
+
+##### sources, objects and libraries #####
+BINNAME = liblfds600
+LIB_BINARY = $(BINDIR)\$(BINNAME).lib
+DLL_BINARY = $(BINDIR)\$(BINNAME).dll
+SRCDIRS = lfds600_abstraction lfds600_freelist lfds600_queue lfds600_ringbuffer lfds600_slist lfds600_stack
+SOURCES = lfds600_abstraction_aligned_free.c lfds600_abstraction_aligned_malloc.c lfds600_abstraction_cas.c lfds600_abstraction_dcas.c lfds600_abstraction_increment.c \
+ lfds600_freelist_delete.c lfds600_freelist_get_and_set.c lfds600_freelist_new.c lfds600_freelist_query.c lfds600_freelist_pop_push.c \
+ lfds600_queue_delete.c lfds600_queue_new.c lfds600_queue_query.c lfds600_queue_queue.c \
+ lfds600_ringbuffer_delete.c lfds600_ringbuffer_get_and_put.c lfds600_ringbuffer_new.c lfds600_ringbuffer_query.c \
+ lfds600_slist_delete.c lfds600_slist_get_and_set.c lfds600_slist_link.c lfds600_slist_new.c \
+ lfds600_stack_delete.c lfds600_stack_new.c lfds600_stack_push_pop.c lfds600_stack_query.c
+OBJECTS = $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES)))
+
+##### tools #####
+MAKE = make
+MFLAGS =
+
+CC = cl
+CBASE = /nologo /W4 /WX /c "-I$(SRCDIR)" "-I$(INCDIR)" "/Fd$(BINDIR)\$(BINNAME).pdb" /DUNICODE /D_UNICODE /DWIN32_LEAN_AND_MEAN
+CFREL = /Ox /DNDEBUG
+CFDBG = /Od /Gm /Zi /D_DEBUG
+
+AR = lib
+AFLAGS = /nologo /subsystem:console /wx /verbose
+
+LD = link
+LFBASE = /dll /def:$(BINNAME).def /nologo /subsystem:console /wx /nodefaultlib /nxcompat
+LFREL = /incremental:no
+LFDBG = /debug "/pdb:$(BINDIR)\$(BINNAME).pdb"
+
+##### variants #####
+CFLAGS = $(CBASE) $(CFDBG) /MTd
+LFLAGS = $(LFBASE) $(LFDBG)
+CLIB = libcmtd.lib
+
+ifeq ($(MAKECMDGOALS),librel)
+ CFLAGS = $(CBASE) $(CFREL) /MT
+ LFLAGS = $(LFBASE) $(LFREL)
+ CLIB = libcmt.lib
+endif
+
+ifeq ($(MAKECMDGOALS),libdbg)
+ CFLAGS = $(CBASE) $(CFDBG) /MTd
+ LFLAGS = $(LFBASE) $(LFDBG)
+ CLIB = libcmtd.lib
+endif
+
+ifeq ($(MAKECMDGOALS),dllrel)
+ CFLAGS = $(CBASE) $(CFREL) /MD
+ LFLAGS = $(LFBASE) $(LFREL)
+ CLIB = msvcrt.lib
+endif
+
+ifeq ($(MAKECMDGOALS),dlldbg)
+ CFLAGS = $(CBASE) $(CFDBG) /MDd
+ LFLAGS = $(LFBASE) $(LFDBG)
+ CLIB = msvcrtd.lib
+endif
+
+##### search paths #####
+vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS))
+
+##### implicit rules #####
+$(OBJDIR)/%.obj : %.c
+ $(CC) $(CFLAGS) "/Fo$@" $<
+
+##### explicit rules #####
+$(LIB_BINARY) : $(OBJECTS)
+ $(AR) $(AFLAGS) $(OBJECTS) /out:$(LIB_BINARY)
+
+$(DLL_BINARY) : $(OBJECTS)
+ $(LD) $(LFLAGS) $(CLIB) $(OBJECTS) /out:$(DLL_BINARY)
+
+##### phony #####
+.PHONY : clean librel libdbg dllrel dlldbg
+
+clean :
+ @erase /Q $(BINDIR)\$(BINNAME).* $(OBJDIR)\*.obj $(QUIETLY)
+
+librel : $(LIB_BINARY)
+libdbg : $(LIB_BINARY)
+
+dllrel : $(DLL_BINARY)
+dlldbg : $(DLL_BINARY)
+
--- /dev/null
+introduction
+============
+Welcome to liblfds, a portable, license-free, lock-free data structure
+library written in C.
+
+platforms
+=========
+Currently liblfds out-of-the-box supports;
+
+Operating System CPU Toolset
+================ ========== =======
+Windows 64-bit IA64 & x64 1. Microsoft Visual Studio 2008
+ 2. Microsoft Windows SDK and GNUmake >= 3.8.1
+
+Windows 32-bit x64 & x86 1. Microsoft Visual Studio 2008
+ 2. Visual C++ 2008 Express Edition
+ 3. Microsoft Windows SDK and GNUmake >= 3.8.1
+
+Windows Kernel IA64, x64, 1. Windows Driver Kit >= 7.0.0
+ x86
+
+Linux 64-bit x64 1. GCC >= 4.1.0 and GNUmake >= 3.8.1
+
+Linux 32-bit x64, x86, 1. GCC >= 4.1.0 and GNUmake >= 3.8.1
+ ARM
+
+data structures
+===============
+Currently liblfds provides the following;
+
+* Freelist
+* Queue
+* Ringbuffer
+* Singly linked list (logical delete only)
+* Stack
+
+liblfds on-line
+===============
+On the liblfds home page, you will find the blog, a bugzilla, a forum, a
+wikipedia and the current and all historical source releases.
+
+The wikipedia contains comprehensive documentation for development,
+building, testing and porting.
+
+http://www.liblfds.org
+
+license
+=======
+There is no license. You are free to use this code in any way.
+
+building
+========
+On Windows, depending on your target platform, one of the following toolchains
+is required;
+
+ * Microsoft Visual Studio 2008 (expensive)
+ * Visual C++ 2008 Express Edition (free, but no 64 bit support)
+ * Microsoft Windows SDK (free, no GUI, has 64 bit support) and GNUmake 3.81
+
+On Windows (kernel-mode), the following toolchain is required;
+
+ * Windows Driver Kit 7.0.0 or later
+
+On Linux, the following toolchain is required;
+
+ * gcc 4.1.0 or later and GNUmake 3.81
+
+For documentation, see the building guide in the wikipedia.
+
+using
+=====
+Once built, there is a single header file, /inc/liblfds.h, which you must include
+in your source code, and a single library file /bin/liblfds.*, where the suffix
+depends on your platform and your build choice (static or dynamic), to which,
+if statically built, you must link directly or, if dynamically built, you must
+arrange your system such that the library can be found by the loader at run-time.
+
+testing
+=======
+The library comes with a command line test and benchmark program. This
+program requires threads. As such, it is only suitable for platforms providing
+thread support and which can execute a command line binary. Currently this
+means the test and benchmark program works for all platforms except the Windows
+Kernel.
+
+For documentation, see the testing and benchmarking guide in the wikipedia.
+
+porting
+=======
+Both the test program and liblfds provide an abstraction layer which acts to
+mask platform differences. Porting is the act of implementing on your platform
+the functions which make up the abstraction layers. You do not need to port
+the test program to port liblfds, but obviously it is recommended, so you can
+test your port.
+
+To support liblfds, your platform must support either contigious double-word
+compare-and-swap (e.g. x86/x64) or contigious double-word load-link/conditional-store
+where normal loads cannot occur inside the LL/CS pair (e.g. ARM) or single word
+load-link/conditional-store where normal loads can occur inside the LL/CS pair.
+
+For documentation, see the porting guide in the wikipedia.
+
+release history
+===============
+release 1, 25th September 2009, svn revision 1574.
+ - initial release
+
+release 2, 5th October 2009, svn revision 1599.
+ - added abstraction layer for Windows kernel
+ - minor code tidyups/fixes
+
+release 3, 25th October 2009, svn revision 1652.
+ - added singly linked list (logical delete only)
+ - minor code tidyups/fixes
+
+release 4, 7th December 2009, svn revision 1716.
+ - added ARM support
+ - added benchmarking functionality to the test program
+ - fixed a profound and pervasive pointer
+ decleration bug; earlier releases of liblfds
+ *should not be used*
+
+release 5, 19th December 2009, svn revision 1738.
+ - fixed subtle queue bug, which also affected ringbuffer
+ and caused data re-ordering under high load
+ - added benchmarks for freelist, ringbuffer and stack
+
+release 6, 29th December 2009, svn revision 1746.
+ - fixed two implementation errors, which reduced performance,
+ spotted by Codeplug from "http://cboard.cprogramming.com".
+
+release 6.0.0, 18th December 2012, svn revision 2537
+ - introduction of namespaces, e.g. the "lfds600_" prefix
+ code otherwise COMPLETE AND WHOLLY UNCHANGED
+ this release is a stepping-stone to 6.1.0
+
--- /dev/null
+The Windows kernel build environment is primitive and has a number
+of severe limitations; in particular, all source files must be in
+one directory and it is not possible to choose the output binary type
+(static or dynamic library) from the build command line; rather,
+a string has to be modified in a text file used by the build (!)
+
+To deal with these limitations, it is necessary for a Windows kernel
+build to run a batch file prior to building.
+
+There are two batch files, one for static library builds and the other
+for dynamic library builds.
+
+They are both idempotent; you can run them as often as you like and
+switch between them as often as you want. It's all fine; whenever
+you run one of them, it will take you from whatever state you were
+previously in, into the state you want to be in.
+
+Both batch files copy all the sources file into a single directory,
+"/src/single_dir_for_windows_kernel/".
+
+The static library batch file will then copy "/sources.static" into
+"/src/single_dir_for_windows_kernel/", which will cause a static
+library to be built.
+
+The dynamic library batch file will then copy "/sources.dynamic" into
+"/src/single_dir_for_windows_kernel/", which will cause a dynamic
+library to be built. It will also copy "src/driver_entry.c" into
+"/src/single_dir_for_windows_kernel/", since the linker requires
+the DriverEntry function to exist for dynamic libraries, even
+though it's not used.
+
+
--- /dev/null
+@echo off
+rmdir /q /s src\single_dir_for_windows_kernel 1>nul 2>nul
+mkdir src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_abstraction\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_freelist\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_queue\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_ringbuffer\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_slist\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_stack\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y sources.dynamic src\single_dir_for_windows_kernel\sources 1>nul 2>nul
+copy /y src\driver_entry.c src\single_dir_for_windows_kernel 1>nul 2>nul
+echo Windows kernel dynamic library build directory structure created.
+echo (Note the effects of this batch file are idempotent).
+
--- /dev/null
+@echo off
+rmdir /q /s src\single_dir_for_windows_kernel 1>nul 2>nul
+mkdir src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_abstraction\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_freelist\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_queue\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_ringbuffer\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_slist\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y src\lfds600_stack\* src\single_dir_for_windows_kernel 1>nul 2>nul
+copy /y sources.static src\single_dir_for_windows_kernel\sources 1>nul 2>nul
+erase /f src\single_dir_for_windows_kernel\driver_entry.c 1>nul 2>nul
+echo Windows kernel static library build directory structure created.
+echo (Note the effects of this batch file are idempotent).
+
--- /dev/null
+MSC_WARNING_LEVEL = /WX /W4
+DLLDEF = ../../liblfds600.def
+TARGETNAME = liblfds600
+TARGETPATH = ../../bin/
+TARGETTYPE = EXPORT_DRIVER
+UMTYPE = nt
+USER_C_FLAGS = /DWIN_KERNEL_BUILD
+
+INCLUDES = ..;../../inc/
+SOURCES = lfds600_abstraction_aligned_free.c \
+ lfds600_abstraction_aligned_malloc.c \
+ lfds600_abstraction_cas.c \
+ lfds600_abstraction_dcas.c \
+ lfds600_abstraction_increment.c \
+ lfds600_freelist_delete.c \
+ lfds600_freelist_get_and_set.c \
+ lfds600_freelist_new.c \
+ lfds600_freelist_pop_push.c \
+ lfds600_freelist_query.c \
+ lfds600_queue_delete.c \
+ lfds600_queue_new.c \
+ lfds600_queue_query.c \
+ lfds600_queue_queue.c \
+ lfds600_ringbuffer_delete.c \
+ lfds600_ringbuffer_get_and_put.c \
+ lfds600_ringbuffer_new.c \
+ lfds600_ringbuffer_query.c \
+ lfds600_slist_delete.c \
+ lfds600_slist_get_and_set.c \
+ lfds600_slist_link.c \
+ lfds600_slist_new.c \
+ lfds600_stack_delete.c \
+ lfds600_stack_new.c \
+ lfds600_stack_push_pop.c \
+ lfds600_stack_query.c \
+ driver_entry.c
+
--- /dev/null
+MSC_WARNING_LEVEL = /WX /W4
+TARGETNAME = liblfds600
+TARGETPATH = ../../bin/
+TARGETTYPE = DRIVER_LIBRARY
+UMTYPE = nt
+USER_C_FLAGS = /DWIN_KERNEL_BUILD
+
+INCLUDES = ..;../../inc/
+SOURCES = lfds600_abstraction_aligned_free.c \
+ lfds600_abstraction_aligned_malloc.c \
+ lfds600_abstraction_cas.c \
+ lfds600_abstraction_dcas.c \
+ lfds600_abstraction_increment.c \
+ lfds600_freelist_delete.c \
+ lfds600_freelist_get_and_set.c \
+ lfds600_freelist_new.c \
+ lfds600_freelist_pop_push.c \
+ lfds600_freelist_query.c \
+ lfds600_queue_delete.c \
+ lfds600_queue_new.c \
+ lfds600_queue_query.c \
+ lfds600_queue_queue.c \
+ lfds600_ringbuffer_delete.c \
+ lfds600_ringbuffer_get_and_put.c \
+ lfds600_ringbuffer_new.c \
+ lfds600_ringbuffer_query.c \
+ lfds600_slist_delete.c \
+ lfds600_slist_get_and_set.c \
+ lfds600_slist_link.c \
+ lfds600_slist_new.c \
+ lfds600_stack_delete.c \
+ lfds600_stack_new.c \
+ lfds600_stack_push_pop.c \
+ lfds600_stack_query.c
+
--- /dev/null
+DIRS = single_dir_for_windows_kernel
+
+
--- /dev/null
+#include "lfds600_stack_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#pragma warning( disable : 4100 )
+
+NTSTATUS DriverEntry( struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath )
+{
+ return( STATUS_SUCCESS );
+}
+
+#pragma warning( default : 4100 )
+
--- /dev/null
+This C file (driver_entry.c) is used when building a dynamic library for
+the Windows kernel. It exists to work around one of the limitations of
+that build environment. It is not used by any other build; just ignore it.
+
--- /dev/null
+#include "lfds600_abstraction_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
+
+ /* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler
+
+ _WIN32 indicates 64-bit or 32-bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ !WIN_KERNEL_BUILD indicates Windows user-mode
+ */
+
+ void lfds600_abstraction_aligned_free( void *memory )
+ {
+ _aligned_free( memory );
+
+ return;
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (_XOPEN_SOURCE >= 600)
+
+ /* TRD : any OS on any CPU with any compiler with POSIX 6.00 or better
+
+ _XOPEN_SOURCE is actually set by the user, not by the compiler
+ it is the way the user signals to the compiler what
+ level of POSIX should be available
+ (it assumes of course the compiler has support for the given level of POSIX requested)
+ */
+
+ void lfds600_abstraction_aligned_free( void *memory )
+ {
+ free( memory );
+
+ return;
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
+
+ /* TRD : any Windows (kernel) on any CPU with the Microsoft C compiler
+
+ _WIN32 indicates 64-bit or 32-bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ WIN_KERNEL_BUILD indicates Windows kernel
+ */
+
+ void lfds600_abstraction_aligned_free( void *memory )
+ {
+ ExFreePoolWithTag( memory, 'sdfl' );
+
+ return;
+ }
+
+#endif
+
--- /dev/null
+#include "lfds600_abstraction_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
+
+ /* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler
+
+ _WIN32 indicates 64-bit or 32-bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ !WIN_KERNEL_BUILD indicates Windows user-mode
+ */
+
+ void *lfds600_abstraction_aligned_malloc( size_t size, size_t align_in_bytes )
+ {
+ void
+ *rv;
+
+ rv = _aligned_malloc( size, align_in_bytes );
+
+ return( rv );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (_XOPEN_SOURCE >= 600)
+
+ /* TRD : any OS on any CPU with any compiler with POSIX 6.00 or better
+
+ _XOPEN_SOURCE is actually set by the user, not by the compiler
+ it is the way the user signals to the compiler what
+ level of POSIX should be available
+ (it assumes of course the compiler has support for the given level of POSIX requested)
+ */
+
+ void *lfds600_abstraction_aligned_malloc( size_t size, size_t align_in_bytes )
+ {
+ int
+ rv;
+
+ void
+ *memory;
+
+ rv = posix_memalign( &memory, align_in_bytes, size );
+
+ // TRD : posix_memalign returns 0 on success, docs do not say *memory == NULL on fail
+ if( rv != 0 )
+ memory = NULL;
+
+ return( memory );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
+
+ /* TRD : any Windows (kernel) on any CPU with the Microsoft C compiler
+
+ _WIN32 indicates 64-bit or 32-bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ WIN_KERNEL_BUILD indicates Windows kernel
+ */
+
+ void *lfds600_abstraction_aligned_malloc( size_t size, size_t align_in_bytes )
+ {
+ void
+ *rv;
+
+ /* TRD : ExAllocatePoolWithTag() allocates memory aligned on 8 bytes on 32-bit CPUs
+ and on 16 bytes on 64-bit CPUs, which is what we want
+
+ as such, align_in_bytes is not needed; we must refer to it to avoid the
+ compiler warning
+ */
+
+ align_in_bytes;
+
+ rv = ExAllocatePoolWithTag( NonPagedPool, size, 'sdfl' );
+
+ return( rv );
+ }
+
+#endif
+
--- /dev/null
+#include "lfds600_abstraction_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN32 && defined _MSC_VER)
+
+ /* TRD : 64 bit and 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler
+
+ _WIN32 indicates 64-bit or 32-bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_cas( volatile lfds600_atom_t *destination, lfds600_atom_t exchange, lfds600_atom_t compare )
+ {
+ assert( destination != NULL );
+ // TRD : exchange can be any value in its range
+ // TRD : compare can be any value in its range
+
+ return( (lfds600_atom_t) _InterlockedCompareExchangePointer((void * volatile *) destination, (void *) exchange, (void *) compare) );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (!defined __arm__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1 && __GNUC_PATCHLEVEL__ >= 0)
+
+ /* TRD : any OS on any CPU except ARM with GCC 4.1.0 or better
+
+ GCC 4.1.0 introduced the __sync_*() atomic intrinsics
+
+ __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ indicates GCC and which version
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_cas( volatile lfds600_atom_t *destination, lfds600_atom_t exchange, lfds600_atom_t compare )
+ {
+ assert( destination != NULL );
+ // TRD : exchange can be any value in its range
+ // TRD : compare can be any value in its range
+
+ // TRD : note the different argument order for the GCC instrinsic to the MSVC instrinsic
+
+ return( (lfds600_atom_t) __sync_val_compare_and_swap(destination, compare, exchange) );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined __arm__ && __GNUC__)
+
+ /* TRD : any OS on any ARM with GCC
+
+ Remember however we need to set into compare the original value of destination.
+
+ __arm__ indicates ARM
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_cas( volatile lfds600_atom_t *destination, lfds600_atom_t exchange, lfds600_atom_t compare )
+ {
+ lfds600_atom_t
+ stored_flag,
+ original_destination;
+
+ assert( destination != NULL );
+ // TRD : exchange can be any value in its range
+ // TRD : compare can be any value in its range
+
+ /* TRD : this is a standard, plain CAS, vulnerable to ABA */
+
+ __asm__ __volatile__
+ (
+ " mov %[stored_flag], #1;" // put 1 into stored_flag
+ " mcr p15, 0, %[zero], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+ "atomic_cas:;"
+ " ldrex %[original_destination], [%[destination]];" // load *destination into original_destination
+ " teq %[original_destination], %[compare];" // compare original_destination with compare
+ " bne exit;" // if not equal, exit
+ " strex %[stored_flag], %[exchange], [%[destination]];" // if equal, try to store exchange into *destination (on success, strex puts 0 into stored_flag)
+ " teq %[stored_flag], #0;" // check if stored_flag is 0
+ " bne atomic_cas;" // if not 0, retry (someone else touched *destination after we loaded but before we stored)
+ " mcr p15, 0, %[zero], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+ "exit:;"
+
+ // output
+ : "+m" (*destination), [original_destination] "=&r" (original_destination), [stored_flag] "=&r" (stored_flag)
+
+ // input
+ : [destination] "r" (destination), [compare] "r" (compare), [exchange] "r" (exchange), [zero] "r" (0)
+
+ // clobbered
+ : "cc", "memory" // memory is clobbered because we issue a memory barrier
+ );
+
+ return( original_destination );
+ }
+
+#endif
+
--- /dev/null
+#include "lfds600_abstraction_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN64 && defined _MSC_VER)
+
+ /* TRD : 64 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler
+
+ _WIN64 indicates 64 bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ unsigned char
+ cas_result;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ cas_result = _InterlockedCompareExchange128( (volatile __int64 *) destination, (__int64) *(exchange+1), (__int64) *exchange, (__int64 *) compare );
+
+ return( cas_result );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER)
+
+ /* TRD : 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler
+
+ (!defined _WIN64 && defined _WIN32) indicates 32 bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ __int64
+ original_compare;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ *(__int64 *) &original_compare = *(__int64 *) compare;
+
+ *(__int64 *) compare = _InterlockedCompareExchange64( (volatile __int64 *) destination, *(__int64 *) exchange, *(__int64 *) compare );
+
+ return( (unsigned char) (*(__int64 *) compare == *(__int64 *) &original_compare) );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined __x86_64__ && __GNUC__ && !defined __pic__)
+
+ /* TRD : any OS on x64 with GCC for statically linked code
+
+ __x86_64__ indicates x64
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ unsigned char
+ cas_result;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ __asm__ __volatile__
+ (
+ "lock;" // make cmpxchg16b atomic
+ "cmpxchg16b %0;" // cmpxchg16b sets ZF on success
+ "setz %3;" // if ZF set, set cas_result to 1
+
+ // output
+ : "+m" (*(volatile lfds600_atom_t (*)[2]) destination), "+a" (*compare), "+d" (*(compare+1)), "=q" (cas_result)
+
+ // input
+ : "b" (*exchange), "c" (*(exchange+1))
+
+ // clobbered
+ : "cc", "memory"
+ );
+
+ return( cas_result );
+ }
+
+#endif
+
+
+
+
+
+
+/****************************************************************************/
+#if (defined __i686__ && __GNUC__ && !defined __pic__)
+
+ /* TRD : any OS on x86 with GCC for statically linked code
+
+ __i686__ indicates x86
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ unsigned char
+ cas_result;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ __asm__ __volatile__
+ (
+ "lock;" // make cmpxchg8b atomic
+ "cmpxchg8b %0;" // cmpxchg8b sets ZF on success
+ "setz %3;" // if ZF set, set cas_result to 1
+
+ // output
+ : "+m" (*(volatile lfds600_atom_t (*)[2]) destination), "+a" (*compare), "+d" (*(compare+1)), "=q" (cas_result)
+
+ // input
+ : "b" (*exchange), "c" (*(exchange+1))
+
+ // clobbered
+ : "cc", "memory"
+ );
+
+ return( cas_result );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined __x86_64__ && __GNUC__ && defined __pic__)
+
+ /* TRD : any OS on x64 with GCC for position independent code (e.g. a shared object)
+
+ __x86_64__ indicates x64
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ unsigned char
+ cas_result;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ /* TRD : with a shared object, we cannot clobber RBX
+ as such, we borrow RSI - we load half of the exchange value into it
+ then swap it with RBX
+ then do the compare-and-swap
+ then swap the original value of RBX back from RSI
+ */
+
+ __asm__ __volatile__
+ (
+ "xchg %%rsi, %%rbx;" // swap RBI and RBX
+ "lock;" // make cmpxchg16b atomic
+ "cmpxchg16b %0;" // cmpxchg16b sets ZF on success
+ "setz %3;" // if ZF set, set cas_result to 1
+ "xchg %%rbx, %%rsi;" // re-swap RBI and RBX
+
+ // output
+ : "+m" (*(volatile lfds600_atom_t (*)[2]) destination), "+a" (*compare), "+d" (*(compare+1)), "=q" (cas_result)
+
+ // input
+ : "S" (*exchange), "c" (*(exchange+1))
+
+ // clobbered
+ : "cc", "memory"
+ );
+
+ return( cas_result );
+ }
+
+#endif
+
+
+
+
+
+
+/****************************************************************************/
+#if (defined __i686__ && __GNUC__ && defined __pic__)
+
+ /* TRD : any OS on x86 with GCC for position independent code (e.g. a shared object)
+
+ __i686__ indicates x86
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ unsigned char
+ cas_result;
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ /* TRD : with a shared object, we cannot clobber EBX
+ as such, we borrow ESI - we load half of the exchange value into it
+ then swap it with EBX
+ then do the compare-and-swap
+ then swap the original value of EBX back from ESI
+ */
+
+ __asm__ __volatile__
+ (
+ "xchg %%esi, %%ebx;" // swap EBI and EBX
+ "lock;" // make cmpxchg8b atomic
+ "cmpxchg8b %0;" // cmpxchg8b sets ZF on success
+ "setz %3;" // if ZF set, set cas_result to 1
+ "xchg %%ebx, %%esi;" // re-swap EBI and EBX
+
+ // output
+ : "+m" (*(volatile lfds600_atom_t (*)[2]) destination), "+a" (*compare), "+d" (*(compare+1)), "=q" (cas_result)
+
+ // input
+ : "S" (*exchange), "c" (*(exchange+1))
+
+ // clobbered
+ : "cc", "memory"
+ );
+
+ return( cas_result );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined __arm__ && __GNUC__)
+
+ /* TRD : any OS on any ARM with GCC
+
+ Remember however we need to set into compare the original value of destination.
+
+ __arm__ indicates ARM
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE unsigned char lfds600_abstraction_dcas( volatile lfds600_atom_t *destination, lfds600_atom_t *exchange, lfds600_atom_t *compare )
+ {
+ lfds600_atom_t
+ *local_compare = compare,
+ stored_flag = 1;
+
+ register lfds600_atom_t
+ local_exchange_a __asm("r2"),
+ local_exchange_b __asm("r3"),
+ local_compare_a __asm("r4"),
+ local_compare_b __asm("r5"),
+ original_destination_a __asm("r6"),
+ original_destination_b __asm("r7");
+
+ assert( destination != NULL );
+ assert( exchange != NULL );
+ assert( compare != NULL );
+
+ /* TRD : some notes
+
+ the double word ldr and str instructions require contigous registers
+ where the first register is an even number
+
+ honouring this requirement requires us to specifically specify
+ the registers to use (which is why we're using register __asm("rN")
+ in the declerations above
+
+ the arguments to the function occupy registers r0, r1 and r2
+
+ we can use up to and including r8, but r9 can have a frame pointer in it
+
+ so we make a copy of compare (freeing up r2, so we can use it for a double
+ word load) but use destination (r0) and exchange (r1) directly
+
+ note LDRD and STRD became available in armv6k
+
+ apologies for the trickery with the mcr register variable - the code runs
+ out of registers on armv6k
+ */
+
+ __asm__ __volatile__
+ (
+ " mov %[stored_flag], #1;" // put 1 into stored_flag
+ " mov %[local_exchange_a], #0;" // borrow local_exchange_a for mcr, to save a register
+ " mcr p15, 0, %[local_exchange_a], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+ " ldrd %[local_exchange_a], %[local_exchange_b], [%[exchange]];" // load exchange into local_exchange_a and local_exchange_b (which are r2 and r3, respectively)
+ " ldrd %[local_compare_a], %[local_compare_b], [%[local_compare]];" // load compare into local_compare_a and local_compare_b (which are r4 and r5, respectively)
+ "atomic_dcas:;"
+ " ldrexd %[original_destination_a], %[original_destination_b], [%[destination]];" // load destination into original_destination_a and original_destination_b (which are r6 and r7, respectively)
+ " teq %[original_destination_a], %[local_compare_a];" // compare the first word of destination with the first word of compare
+ " teqeq %[original_destination_b], %[local_compare_b];" // if they're equal, compare the second word of destination with the second word of compare
+ " bne exit;" // if either word of destination does not match its respective word of compare, exit
+ " strexd %[stored_flag], %[local_exchange_a], %[local_exchange_b], [%[destination]];" // if both words were equal, try to store local_exchange_a and local_exchange_b into *destination (on success, strexed puts 0 into stored_flag)
+ " teq %[stored_flag], #0;" // check if stored_flag is 0
+ " bne atomic_dcas;" // if not 0, retry (someone else touched *destination after we loaded but before we stored)
+ "exit:;"
+ " strd %[original_destination_a], %[original_destination_b], [%[local_compare]];" // whether or not the CAS swapped, we always write the original value of destination into *compare
+ " mov %[local_exchange_a], #0;" // borrow local_exchange_a for mcr, to save a register
+ " mcr p15, 0, %[local_exchange_a], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+
+ // output
+ : "+m" (*(volatile lfds600_atom_t (*)[2]) destination), "+m" (*(lfds600_atom_t (*)[2]) local_compare),
+ [stored_flag] "+&r" (stored_flag),
+ [original_destination_a] "+&r" (original_destination_a), [original_destination_b] "+&r" (original_destination_b),
+ [local_compare_a] "+&r" (local_compare_a), [local_compare_b] "+&r" (local_compare_b),
+ [local_exchange_a] "+&r" (local_exchange_a), [local_exchange_b] "+&r" (local_exchange_b)
+
+ // input
+ : "m" (*(lfds600_atom_t (*)[2]) exchange),
+ [destination] "r" (destination),
+ [local_compare] "r" (local_compare),
+ [exchange] "r" (exchange)
+
+ // clobbered
+ : "cc", "memory" // memory is clobbered because we issue a memory barrier
+ );
+
+ /* TRD : stored_flag is set to 0 on store, 1 on fail
+ we need to return 1 on success, 0 on fail
+ */
+
+ return( (unsigned char) !stored_flag );
+ }
+
+#endif
+
+
--- /dev/null
+#include "lfds600_abstraction_internal.h"
+
+
+
+
+
+/****************************************************************************/
+#if (defined _WIN64 && defined _MSC_VER)
+
+ /* TRD : 64 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler
+
+ _WIN64 indicates 64 bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_increment( lfds600_atom_t *value )
+ {
+ __int64
+ rv;
+
+ assert( value != NULL );
+
+ rv = _InterlockedIncrement64( (__int64 *) value );
+
+ return( (lfds600_atom_t) rv );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER)
+
+ /* TRD : 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler
+
+ (!defined _WIN64 && defined _WIN32) indicates 32 bit Windows
+ _MSC_VER indicates Microsoft C compiler
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_increment( lfds600_atom_t *value )
+ {
+ long int
+ rv;
+
+ assert( value != NULL );
+
+ rv = _InterlockedIncrement( (long int *) value );
+
+ return( (lfds600_atom_t) rv );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (!defined __arm__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1 && __GNUC_PATCHLEVEL__ >= 0)
+
+ /* TRD : any OS on any CPU with GCC 4.1.0 or better
+
+ GCC 4.1.0 introduced the __sync_*() atomic intrinsics
+
+ __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ indicates GCC and which version
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_increment( lfds600_atom_t *value )
+ {
+ lfds600_atom_t
+ rv;
+
+ assert( value != NULL );
+
+ // TRD : no need for casting here, GCC has a __sync_add_and_fetch() for all native types
+
+ rv = __sync_add_and_fetch( value, 1 );
+
+ return( rv );
+ }
+
+#endif
+
+
+
+
+
+/****************************************************************************/
+#if (defined __arm__ && __GNUC__ >= 4)
+
+ /* TRD : any OS on any CPU with GCC 4.1.0 or better
+
+ GCC 4.1.0 introduced the __sync_*() atomic intrinsics
+
+ __arm__ indicates ARM
+ __GNUC__ indicates GCC
+ */
+
+ LFDS600_INLINE lfds600_atom_t lfds600_abstraction_increment( lfds600_atom_t *value )
+ {
+ lfds600_atom_t
+ stored_flag = 0,
+ new_value = 0;
+
+ assert( value != NULL );
+
+ __asm__ __volatile__
+ (
+ " mov %[stored_flag], #1;" // move 1 into stored_flag
+ " mcr p15, 0, %[zero], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+ "atomic_add:;"
+ " ldrex %[new_value], [%[value]]; " // load *value into new_value
+ " add %[new_value], #1;" // add 1 to new_value
+ " strex %[stored_flag], %[new_value], [%[value]];" // try to store new_value into *value (on success, strex puts 0 into stored_flag)
+ " teq %[stored_flag], #0;" // check if stored_flag is 0
+ " bne atomic_add;" // if not 0, retry (someone else touched *value after we loaded but before we stored)
+ " mcr p15, 0, %[zero], c7, c10, 5;" // memory barrier (ARM v6 compatible)
+
+ // output
+ : "+m" (*value), [new_value] "+&r" (new_value), [stored_flag] "+&r" (stored_flag)
+
+ // input
+ : [value] "r" (value), [zero] "r" (0)
+
+ // clobbered
+ : "cc", "memory" // memory is clobbered because we issue a memory barrier
+ );
+
+ return( new_value );
+ }
+
+#endif
+
--- /dev/null
+/***** the library wide include file *****/
+#include "lfds600_internal.h"
+
+/***** private prototypes *****/
+
--- /dev/null
+#include "lfds600_freelist_internal.h"
+
+
+
+
+
+/****************************************************************************/
+void lfds600_freelist_delete( struct lfds600_freelist_state *fs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state )
+{
+ struct lfds600_freelist_element
+ *fe;
+
+ void
+ *user_data;
+
+ assert( fs != NULL );
+ // TRD : user_data_delete_function can be NULL
+ // TRD : user_state can be NULL
+
+ while( lfds600_freelist_pop(fs, &fe) )
+ {
+ if( user_data_delete_function != NULL )
+ {
+ lfds600_freelist_get_user_data_from_element( fe, &user_data );
+ user_data_delete_function( user_data, user_state );
+ }
+
+ lfds600_abstraction_aligned_free( fe );
+ }
+
+ lfds600_abstraction_aligned_free( fs );
+
+ return;
+}
+
--- /dev/null
+#include "lfds600_freelist_internal.h"
+
+
+
+
+
+/****************************************************************************/
+void *lfds600_freelist_get_user_data_from_element( struct lfds600_freelist_element *fe, void **user_data )
+{
+ assert( fe != NULL );
+ // TRD : user_data can be NULL
+
+ if( user_data != NULL )
+ *user_data = fe->user_data;
+
+ return( fe->user_data );
+}
+
+
+
+
+
+/****************************************************************************/
+void lfds600_freelist_set_user_data_in_element( struct lfds600_freelist_element *fe, void *user_data )
+{
+ assert( fe != NULL );
+ // TRD : user_data can be NULL
+
+ fe->user_data = user_data;
+
+ return;
+}
+
--- /dev/null
+/***** the library wide include file *****/
+#include "lfds600_internal.h"
+
+/***** defines *****/
+#define LFDS600_FREELIST_POINTER 0
+#define LFDS600_FREELIST_COUNTER 1
+#define LFDS600_FREELIST_PAC_SIZE 2
+
+/***** structures *****/
+#pragma pack( push, LFDS600_ALIGN_DOUBLE_POINTER )
+
+struct lfds600_freelist_state
+{
+ struct lfds600_freelist_element
+ *volatile top[LFDS600_FREELIST_PAC_SIZE];
+
+ int
+ (*user_data_init_function)( void **user_data, void *user_state );
+
+ void
+ *user_state;
+
+ lfds600_atom_t
+ aba_counter,
+ element_count;
+};
+
+struct lfds600_freelist_element
+{
+ struct lfds600_freelist_element
+ *next[LFDS600_FREELIST_PAC_SIZE];
+
+ void
+ *user_data;
+};
+
+#pragma pack( pop )
+
+/***** private prototypes *****/
+lfds600_atom_t lfds600_freelist_internal_new_element( struct lfds600_freelist_state *fs, struct lfds600_freelist_element **fe );
+void lfds600_freelist_internal_validate( struct lfds600_freelist_state *fs, struct lfds600_validation_info *vi, enum data_structure_validity *lfds600_freelist_validity );
+
--- /dev/null
+#include "lfds600_freelist_internal.h"
+
+
+
+
+
+/****************************************************************************/
+int lfds600_freelist_new( struct lfds600_freelist_state **fs, lfds600_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state )
+{
+ int
+ rv = 0;
+
+ lfds600_atom_t
+ element_count;
+
+ assert( fs != NULL );
+ // TRD : number_elements can be any value in its range
+ // TRD : user_data_init_function can be NULL
+
+ *fs = (struct lfds600_freelist_state *) lfds600_abstraction_aligned_malloc( sizeof(struct lfds600_freelist_state), LFDS600_ALIGN_DOUBLE_POINTER );
+
+ if( (*fs) != NULL )
+ {
+ (*fs)->top[LFDS600_FREELIST_POINTER] = NULL;
+ (*fs)->top[LFDS600_FREELIST_COUNTER] = 0;
+ (*fs)->user_data_init_function = user_data_init_function;
+ (*fs)->user_state = user_state;
+ (*fs)->aba_counter = 0;
+ (*fs)->element_count = 0;
+
+ element_count = lfds600_freelist_new_elements( *fs, number_elements );
+
+ if( element_count == number_elements )
+ rv = 1;
+
+ if( element_count != number_elements )
+ {
+ lfds600_abstraction_aligned_free( (*fs) );
+ *fs = NULL;
+ }
+ }
+
+ return( rv );
+}
+
+
+
+
+
+/****************************************************************************/
+lfds600_atom_t lfds600_freelist_new_elements( struct lfds600_freelist_state *fs, lfds600_atom_t number_elements )
+{
+ struct lfds600_freelist_element
+ *fe;
+
+ lfds600_atom_t
+ loop,
+ count = 0;
+
+ assert( fs != NULL );
+ // TRD : number_elements&n