OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ | 5 #ifndef BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ |
6 #define BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ | 6 #define BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <atomic> | 10 #include <atomic> |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 843 |
844 private: | 844 private: |
845 // The underlying object that does the actual allocation of memory. Its | 845 // The underlying object that does the actual allocation of memory. Its |
846 // lifetime must exceed that of all DelayedPersistentAllocation objects | 846 // lifetime must exceed that of all DelayedPersistentAllocation objects |
847 // that use it. | 847 // that use it. |
848 PersistentMemoryAllocator* const allocator_; | 848 PersistentMemoryAllocator* const allocator_; |
849 | 849 |
850 // The desired type and size of the allocated segment plus the offset | 850 // The desired type and size of the allocated segment plus the offset |
851 // within it for the defined request. | 851 // within it for the defined request. |
852 const uint32_t type_; | 852 const uint32_t type_; |
853 const size_t size_; | 853 const uint32_t size_; |
854 const size_t offset_; | 854 const uint32_t offset_; |
855 | 855 |
856 // Flag indicating if allocation should be made iterable when done. | 856 // Flag indicating if allocation should be made iterable when done. |
857 const bool make_iterable_; | 857 const bool make_iterable_; |
858 | 858 |
859 // The location at which a reference to the allocated segment is to be | 859 // The location at which a reference to the allocated segment is to be |
860 // stored once the allocation is complete. If multiple delayed allocations | 860 // stored once the allocation is complete. If multiple delayed allocations |
861 // share the same pointer then an allocation on one will amount to an | 861 // share the same pointer then an allocation on one will amount to an |
862 // allocation for all. | 862 // allocation for all. |
863 volatile std::atomic<Reference>* const reference_; | 863 volatile std::atomic<Reference>* const reference_; |
864 | 864 |
865 // No DISALLOW_COPY_AND_ASSIGN as it's okay to copy/move these objects. | 865 // No DISALLOW_COPY_AND_ASSIGN as it's okay to copy/move these objects. |
866 }; | 866 }; |
867 | 867 |
868 } // namespace base | 868 } // namespace base |
869 | 869 |
870 #endif // BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ | 870 #endif // BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ |
OLD | NEW |