Mempool: delay allocating an initial chunk, its not always used
[blender.git] / source / blender / bmesh / tools / bmesh_edgenet.c
index 44188d9c34cef158a92e039c228bea4108db0103..55df5cbc955f6b572382d7b3ac88ae456d8fffd5 100644 (file)
 #include "BLI_linklist.h"
 
 #include "bmesh.h"
+#include "bmesh_edgenet.h"  /* own include */
+
+#include "BLI_strict_flags.h"  /* keep last */
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
 
-/* Data for one end of an edge involved in a bevel */
+/* Struct for storing a path of verts walked over */
 typedef struct VertNetInfo {
        BMVert *prev;               /* previous vertex */
        int pass;                   /* path scanning pass value, for internal calculation */
@@ -225,7 +221,7 @@ static BMEdge *bm_edgenet_path_step(
 
                                        if (vn_curr->pass == -vn_next->pass) {
                                                if ((vn_curr->flag & VNINFO_FLAG_IS_MIXFACE) ||
-                                                       (vn_next->flag & VNINFO_FLAG_IS_MIXFACE))
+                                                   (vn_next->flag & VNINFO_FLAG_IS_MIXFACE))
                                                {
                                                        /* found connecting edge */
                                                        if (bm_edgenet_path_check_overlap(v_curr, v_next, vnet_info) == false) {
@@ -241,8 +237,8 @@ static BMEdge *bm_edgenet_path_step(
                                                /* flush flag down the path */
                                                vn_next->flag &= ~VNINFO_FLAG_IS_MIXFACE;
                                                if ((vn_curr->flag & VNINFO_FLAG_IS_MIXFACE) ||
-                                                       (vn_next->face == -1) ||
-                                                       (vn_next->face != vn_curr->face))
+                                                   (vn_next->face == -1) ||
+                                                   (vn_next->face != vn_curr->face))
                                                {
                                                        vn_next->flag |= VNINFO_FLAG_IS_MIXFACE;
                                                }
@@ -447,8 +443,8 @@ void BM_mesh_edgenet(BMesh *bm,
                      const bool use_edge_tag, const bool use_new_face_tag)
 {
        VertNetInfo *vnet_info = MEM_callocN(sizeof(*vnet_info) * (size_t)bm->totvert, __func__);
-       BLI_mempool *edge_queue_pool = BLI_mempool_create(sizeof(LinkNode), 1, 512, 0);
-       BLI_mempool *path_pool = BLI_mempool_create(sizeof(LinkNode), 1, 512, 0);
+       BLI_mempool *edge_queue_pool = BLI_mempool_create(sizeof(LinkNode), 0, 512, BLI_MEMPOOL_NOP);
+       BLI_mempool *path_pool = BLI_mempool_create(sizeof(LinkNode), 0, 512, BLI_MEMPOOL_NOP);
        LinkNode *edge_queue = NULL;
 
        BMEdge *e;