Fixed HP/DHP thread data initialization
[libcds.git] / cds / gc / dhp_smr.h
index d8c3e9f6ab946903d7d87dcea68b71718444d7c6..7d0b5d7d7a31da59fa077f80082d768bd6c79193 100644 (file)
@@ -73,8 +73,8 @@ namespace cds { namespace gc {
         public:
             static hp_allocator& instance();
 
-            CDS_EXPORT_API guard_block*    alloc();
-            void            free( guard_block* block )
+            CDS_EXPORT_API guard_block* alloc();
+            void free( guard_block* block )
             {
                 free_list_.put( block );
             }
@@ -98,7 +98,10 @@ namespace cds { namespace gc {
                 , extended_list_( nullptr )
                 , array_( arr )
                 , initial_capacity_( nSize )
-            {}
+            {
+                // Initialize guards
+                new( arr ) guard[nSize];
+            }
 
             thread_hp_storage() = delete;
             thread_hp_storage( thread_hp_storage const& ) = delete;