summaryrefslogtreecommitdiff
path: root/core/templates
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-09-24 01:19:49 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-09-24 02:33:15 +0200
commit6def32d643b9be6dba8f5e355e3dd75d82814bed (patch)
tree7176c6ff1e3dc4f1461250b7010562bfb5c79f29 /core/templates
parente92064fbef13e651722ee47ae826de080757bc2e (diff)
Replace `#pragma once` by traditional include guards for consistency
`#pragma once` was used in a few files, yet we settled on using traditional include guards instead. The PooledList template comment was also moved to allow editors such as Visual Studio Code to display the comment when hovering PooledList. `app.h` was renamed to `app_uwp.h` to be less generic for the include guard.
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/pooled_list.h14
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