1
0
Fork 0

Let's not pass copies of huge structures on the stack ... ye might see a

segfault ... :-)
This commit is contained in:
curt 1999-03-18 04:31:10 +00:00
parent 7e237e7572
commit 62670d0514
3 changed files with 18 additions and 3 deletions

View file

@ -54,6 +54,7 @@ FG_USING_STD(vector);
typedef vector < gpc_polygon * > gpcpoly_container;
typedef gpcpoly_container::iterator gpcpoly_iterator;
typedef gpcpoly_container::const_iterator const_gpcpoly_iterator;
#define FG_MAX_AREAS 20
@ -108,6 +109,10 @@ public:
// $Log$
// Revision 1.4 1999/03/18 04:31:10 curt
// Let's not pass copies of huge structures on the stack ... ye might see a
// segfault ... :-)
//
// Revision 1.3 1999/03/17 23:48:59 curt
// minor renaming and a bit of rearranging.
//

View file

@ -36,13 +36,13 @@ FGTriangle::~FGTriangle( void ) {
// populate this class based on the specified gpc_polys list
int FGTriangle::build( FGgpcPolyList gpc_polys ) {
int FGTriangle::build( const FGgpcPolyList& gpc_polys ) {
// traverse the gpc_polys and build a unified node list and a set
// of Triangle PSLG that reference the node list by index
// (starting at zero)
gpc_polygon *gpc_poly;
gpcpoly_iterator current, last;
const_gpcpoly_iterator current, last;
// process polygons in priority order
cout << "prepairing node list and polygons" << endl;
@ -64,10 +64,16 @@ int FGTriangle::build( FGgpcPolyList gpc_polys ) {
}
}
}
return 0;
}
// $Log$
// Revision 1.2 1999/03/18 04:31:11 curt
// Let's not pass copies of huge structures on the stack ... ye might see a
// segfault ... :-)
//
// Revision 1.1 1999/03/17 23:51:59 curt
// Initial revision.
//

View file

@ -66,7 +66,7 @@ public:
~FGTriangle( void );
// populate this class based on the specified gpc_polys list
int build( FGgpcPolyList gpc_polys );
int build( const FGgpcPolyList& gpc_polys );
};
@ -74,6 +74,10 @@ public:
// $Log$
// Revision 1.2 1999/03/18 04:31:12 curt
// Let's not pass copies of huge structures on the stack ... ye might see a
// segfault ... :-)
//
// Revision 1.1 1999/03/17 23:51:59 curt
// Initial revision.
//