diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-09-24 08:28:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 08:28:00 +0200 |
commit | cc23d6d27094af4a8ed51cf9ac7a473011e1161f (patch) | |
tree | 7176c6ff1e3dc4f1461250b7010562bfb5c79f29 /core | |
parent | e92064fbef13e651722ee47ae826de080757bc2e (diff) | |
parent | 6def32d643b9be6dba8f5e355e3dd75d82814bed (diff) |
Merge pull request #52988 from Calinou/remove-pragma-once
Replace `#pragma once` by traditional include guards for consistency
Diffstat (limited to 'core')
-rw-r--r-- | core/templates/pooled_list.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/templates/pooled_list.h b/core/templates/pooled_list.h index b4a6d2d1dd..b139dadb75 100644 --- a/core/templates/pooled_list.h +++ b/core/templates/pooled_list.h @@ -28,13 +28,16 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#pragma once +#ifndef POOLED_LIST_H +#define POOLED_LIST_H + +#include "core/templates/local_vector.h" // Simple template to provide a pool with O(1) allocate and free. // The freelist could alternatively be a linked list placed within the unused elements // to use less memory, however a separate freelist is probably more cache friendly. - -// NOTE : Take great care when using this with non POD types. The construction and destruction +// +// NOTE: Take great care when using this with non POD types. The construction and destruction // is done in the LocalVector, NOT as part of the pool. So requesting a new item does not guarantee // a constructor is run, and free does not guarantee a destructor. // You should generally handle clearing @@ -42,9 +45,6 @@ // This is by design for fastest use in the BVH. If you want a more general pool // that does call constructors / destructors on request / free, this should probably be // a separate template. - -#include "core/templates/local_vector.h" - template <class T, bool force_trivial = false> class PooledList { LocalVector<T, uint32_t, force_trivial> list; @@ -93,3 +93,5 @@ public: _used_size--; } }; + +#endif // POOLED_LIST_H |