mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-09-07 19:36:23 +02:00
A number of things in one commit:
1) Added a "*showmem" "wizard" command to get a dump of all memory being used by tiles in the database. 2) Made a slight correction to the way magic detects exact overlap of instances of the same cell. This probably does not make any actual difference in practice. 3) Corrected an uninitialized variable in dbReComputeBboxFunc(). 4) Changes DBSrCellPlaneArea() to use a static BPEnum variable, so that it does not waste time allocating and freeing memory for the same thing over and over again. 5) Corrected a memory leak in the tech file "extract" section that loses memory every time the extraction style is changed. 6) Corrected the tile join routines to fix a bad memory leak in the tile allocation and recovery---a fix which was mentioned in issue #414 but which had not yet been implemented. This has now been tested and confirmed to work.
This commit is contained in:
+11
-2
@@ -109,14 +109,23 @@ DBCellFindDup(use, parent)
|
||||
while ((dupUse = BPEnumNext(&bpe)))
|
||||
if (dupUse->cu_def == use->cu_def)
|
||||
/* Transforms must be equal---Aligned bounding boxes are
|
||||
* an insufficient measure of exact overlap.
|
||||
* an insufficient measure of exact overlap. Also, array
|
||||
* counts and separation must match for arrayed devices
|
||||
*/
|
||||
if ((dupUse->cu_transform.t_a == use->cu_transform.t_a) &&
|
||||
(dupUse->cu_transform.t_b == use->cu_transform.t_b) &&
|
||||
(dupUse->cu_transform.t_c == use->cu_transform.t_c) &&
|
||||
(dupUse->cu_transform.t_d == use->cu_transform.t_d) &&
|
||||
(dupUse->cu_transform.t_e == use->cu_transform.t_e) &&
|
||||
(dupUse->cu_transform.t_f == use->cu_transform.t_f))
|
||||
(dupUse->cu_transform.t_f == use->cu_transform.t_f) &&
|
||||
((dupUse->cu_xhi > dupUse->cu_xlo) &&
|
||||
((dupUse->cu_xhi - dupUse->cu_xlo) ==
|
||||
(use->cu_xhi - use->cu_xlo)) &&
|
||||
(dupUse->cu_xsep == use->cu_xsep)) &&
|
||||
((dupUse->cu_yhi > dupUse->cu_ylo) &&
|
||||
((dupUse->cu_yhi - dupUse->cu_ylo) ==
|
||||
(use->cu_yhi - use->cu_ylo)) &&
|
||||
(dupUse->cu_ysep == use->cu_ysep)))
|
||||
break;
|
||||
|
||||
BPEnumTerm(&bpe);
|
||||
|
||||
@@ -619,10 +619,9 @@ dbReComputeBboxFunc(cellDef, boundProc, recurseProc)
|
||||
/*
|
||||
* Include area of subcells separately
|
||||
*/
|
||||
if ((foundAny = DBBoundCellPlane(cellDef, &extended, &rect)) > 0)
|
||||
area = rect;
|
||||
else
|
||||
if (!((foundAny = DBBoundCellPlane(cellDef, &extended, &rect)) > 0))
|
||||
extended = GeoNullRect;
|
||||
area = rect;
|
||||
|
||||
for (pNum = PL_PAINTBASE; pNum < DBNumPlanes; pNum++)
|
||||
if (pNum != PL_DRC_CHECK)
|
||||
|
||||
@@ -85,11 +85,13 @@ struct seeTypesArg
|
||||
int
|
||||
DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg)
|
||||
{
|
||||
BPEnum sbpe;
|
||||
BPEnum *bpe;
|
||||
CellUse *use;
|
||||
int rval = 0;
|
||||
|
||||
bpe = (BPEnum *)mallocMagic(sizeof(BPEnum));
|
||||
/* bpe = (BPEnum *)mallocMagic(sizeof(BPEnum)); */
|
||||
bpe = &sbpe;
|
||||
BPEnumInit(bpe, plane, rect, BPE_OVERLAP, "DBSrCellPlaneArea");
|
||||
|
||||
while ((use = BPEnumNext(bpe)))
|
||||
@@ -102,7 +104,7 @@ DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg
|
||||
}
|
||||
|
||||
BPEnumTerm(bpe);
|
||||
freeMagic(bpe);
|
||||
/* freeMagic(bpe); */
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,6 +194,8 @@ typedef struct
|
||||
extern int dbNumSavedRules;
|
||||
extern Rule dbSavedRules[];
|
||||
|
||||
extern HashTable dbCellDefTable; /* Exported for diagnostics */
|
||||
|
||||
/* -------------------- Internal procedure headers -------------------- */
|
||||
|
||||
extern void DBUndoPutLabel();
|
||||
|
||||
Reference in New Issue
Block a user