Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-24 17:08:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-24 17:08:55 +0400
commitf2acb10b6b160b9ab85591d4717e27be800a0568 (patch)
tree367c137cfb82c88e2fbe5ab3e4ae23d0ea18731d
parent9c090cecfe21ef357031373b0711a2bc57ee5176 (diff)
edge hash: take an arg for the guarded-malloc string (as ghash does)
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c6
-rw-r--r--source/blender/blenkernel/intern/cloth.c2
-rw-r--r--source/blender/blenkernel/intern/mesh.c8
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c4
-rw-r--r--source/blender/blenkernel/intern/particle_system.c2
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c4
-rw-r--r--source/blender/blenlib/BLI_edgehash.h5
-rw-r--r--source/blender/blenlib/intern/edgehash.c9
-rw-r--r--source/blender/editors/armature/meshlaplacian.c2
-rw-r--r--source/blender/editors/armature/reeb.c2
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c4
-rw-r--r--source/blender/render/intern/source/convertblender.c2
12 files changed, 26 insertions, 24 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 00a2c45d8fd..097fb09b86b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -2405,7 +2405,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
STACK_DECLARE(mpoly);
STACK_DECLARE(oldp);
- EdgeHash *ehash = BLI_edgehash_new();
+ EdgeHash *ehash = BLI_edgehash_new(__func__);
int i, j, c;
@@ -2607,7 +2607,7 @@ void CDDM_calc_edges_tessface(DerivedMesh *dm)
EdgeHashIterator *ehi;
MFace *mf = cddm->mface;
MEdge *med;
- EdgeHash *eh = BLI_edgehash_new();
+ EdgeHash *eh = BLI_edgehash_new(__func__);
int i, *index, numEdges, maxFaces = dm->numTessFaceData;
for (i = 0; i < maxFaces; i++, mf++) {
@@ -2668,7 +2668,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
MPoly *mp = cddm->mpoly;
MLoop *ml;
MEdge *med, *origmed;
- EdgeHash *eh = BLI_edgehash_new();
+ EdgeHash *eh = BLI_edgehash_new(__func__);
int v1, v2;
int *eindex;
int i, j, *index, numEdges = cddm->dm.numEdgeData, maxFaces = dm->numPolyData;
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 05ffd4a6265..96c8cc7e507 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1109,7 +1109,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
MEM_freeN ( cloth->springs );
// create spring network hash
- edgehash = BLI_edgehash_new();
+ edgehash = BLI_edgehash_new(__func__);
// structural springs
for ( i = 0; i < numedges; i++ ) {
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index a6a85e82a4a..6170e989407 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -177,7 +177,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
if (l1->type == CD_MEDGE) {
MEdge *e1 = l1->data;
MEdge *e2 = l2->data;
- EdgeHash *eh = BLI_edgehash_new();
+ EdgeHash *eh = BLI_edgehash_new(__func__);
int etot = m1->totedge;
for (j = 0; j < etot; j++, e1++) {
@@ -911,7 +911,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
MPoly *mpoly;
MFace *mface;
MEdge *medge, *med;
- EdgeHash *hash = BLI_edgehash_new();
+ EdgeHash *hash = BLI_edgehash_new(__func__);
struct EdgeSort *edsort, *ed;
int a, totedge = 0;
unsigned int totedge_final = 0;
@@ -1243,7 +1243,7 @@ static void make_edges_mdata_extend(MEdge **r_alledge, int *r_totedge,
const MPoly *mp;
int i;
- eh = BLI_edgehash_new();
+ eh = BLI_edgehash_new(__func__);
for (i = 0, mp = mpoly; i < totpoly; i++, mp++) {
BKE_mesh_poly_edgehash_insert(eh, mp, mloop + mp->loopstart);
@@ -2307,7 +2307,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData
CustomData_external_read(fdata, id, CD_MASK_MDISPS, totface_i);
}
- eh = BLI_edgehash_new();
+ eh = BLI_edgehash_new(__func__);
/* build edge hash */
me = medge;
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 2eced15a147..512f205728d 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -216,7 +216,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
bool do_edge_recalc = false;
- EdgeHash *edge_hash = BLI_edgehash_new();
+ EdgeHash *edge_hash = BLI_edgehash_new(__func__);
BLI_assert(!(do_fixes && mesh == NULL));
@@ -921,7 +921,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
EdgeHashIterator *ehi;
MPoly *mp;
MEdge *med, *med_orig;
- EdgeHash *eh = BLI_edgehash_new();
+ EdgeHash *eh = BLI_edgehash_new(__func__);
int i, totedge, totpoly = mesh->totpoly;
int med_index;
/* select for newly created meshes which are selected [#25595] */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 8cb9404a647..f97098b43bf 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2484,7 +2484,7 @@ static EdgeHash *sph_springhash_build(ParticleSystem *psys)
ParticleSpring *spring;
int i = 0;
- springhash = BLI_edgehash_new();
+ springhash = BLI_edgehash_new(__func__);
for (i=0, spring=psys->fluid_springs; i<psys->tot_fluidsprings; i++, spring++)
BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], SET_INT_IN_POINTER(i+1));
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 35482d9553d..696248f6940 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -334,7 +334,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
}
/* create edges */
- ehash = BLI_edgehash_new();
+ ehash = BLI_edgehash_new(__func__);
for (i = 0; i < totface; i++) {
MPoly *mp = &((MPoly *) mpoly)[i];
@@ -1332,7 +1332,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
if (!ccgdm->ehash) {
MEdge *medge;
- ccgdm->ehash = BLI_edgehash_new();
+ ccgdm->ehash = BLI_edgehash_new(__func__);
medge = ccgdm->dm.getEdgeArray((DerivedMesh *)ccgdm);
for (i = 0; i < ccgdm->dm.numEdgeData; i++) {
diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h
index f961d73cd79..80eac9199e3 100644
--- a/source/blender/blenlib/BLI_edgehash.h
+++ b/source/blender/blenlib/BLI_edgehash.h
@@ -40,8 +40,9 @@ enum {
EDGEHASH_FLAG_ALLOW_DUPES = (1 << 0), /* only checked for in debug mode */
};
-EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve);
-EdgeHash *BLI_edgehash_new(void);
+EdgeHash *BLI_edgehash_new_ex(const char *info,
+ const unsigned int nentries_reserve);
+EdgeHash *BLI_edgehash_new(const char *info);
void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp);
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
void BLI_edgehash_assign(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c
index 738f1f0c7a1..25db659b3d4 100644
--- a/source/blender/blenlib/intern/edgehash.c
+++ b/source/blender/blenlib/intern/edgehash.c
@@ -162,9 +162,10 @@ static void edgehash_insert_ex(EdgeHash *eh, unsigned int v0, unsigned int v1, v
/* Public API */
-EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve)
+EdgeHash *BLI_edgehash_new_ex(const char *info,
+ const unsigned int nentries_reserve)
{
- EdgeHash *eh = MEM_callocN(sizeof(*eh), "EdgeHash");
+ EdgeHash *eh = MEM_mallocN(sizeof(*eh), info);
eh->nbuckets = _ehash_hashsizes[0]; /* eh->cursize */
eh->nentries = 0;
@@ -184,9 +185,9 @@ EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve)
return eh;
}
-EdgeHash *BLI_edgehash_new(void)
+EdgeHash *BLI_edgehash_new(const char *info)
{
- return BLI_edgehash_new_ex(0);
+ return BLI_edgehash_new_ex(info, 0);
}
/**
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 76068c122bf..9fe4be7fbf1 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -281,7 +281,7 @@ static void laplacian_system_construct_end(LaplacianSystem *sys)
sys->varea = MEM_callocN(sizeof(float) * totvert, "LaplacianSystemVarea");
- sys->edgehash = BLI_edgehash_new();
+ sys->edgehash = BLI_edgehash_new(__func__);
for (a = 0, face = sys->faces; a < sys->totface; a++, face++) {
laplacian_increase_edge_count(sys->edgehash, (*face)[0], (*face)[1]);
laplacian_increase_edge_count(sys->edgehash, (*face)[1], (*face)[2]);
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index f66fb38a2a6..3a09f531d44 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -198,7 +198,7 @@ ReebGraph *newReebGraph(void)
rg = MEM_callocN(sizeof(ReebGraph), "reeb graph");
rg->totnodes = 0;
- rg->emap = BLI_edgehash_new();
+ rg->emap = BLI_edgehash_new(__func__);
rg->free_arc = REEB_freeArc;
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index c4aa41cd566..f6b882c5a69 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -568,7 +568,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
int numlayer;
unsigned int ed_v1, ed_v2;
- edgehash = BLI_edgehash_new();
+ edgehash = BLI_edgehash_new(__func__);
/* recreate vertpa from facepa calculation */
for (i = 0, mf = mface; i < totface; i++, mf++) {
@@ -821,7 +821,7 @@ static DerivedMesh *explodeMesh(ExplodeModifierData *emd,
cfra = BKE_scene_frame_get(scene);
/* hash table for vertice <-> particle relations */
- vertpahash = BLI_edgehash_new();
+ vertpahash = BLI_edgehash_new(__func__);
for (i = 0; i < totface; i++) {
if (facepa[i] != totpart) {
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 698c46c1e8d..a0104a30d0e 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -3279,7 +3279,7 @@ static EdgeHash *make_freestyle_edge_mark_hash(Mesh *me, DerivedMesh *dm)
index = dm->getEdgeDataArray(dm, CD_ORIGINDEX);
fed = CustomData_get_layer(&me->edata, CD_FREESTYLE_EDGE);
if (fed) {
- edge_hash = BLI_edgehash_new();
+ edge_hash = BLI_edgehash_new(__func__);
if (!index) {
if (me->totedge == totedge) {
for (a = 0; a < me->totedge; a++) {