pfLinux memory weirdness

New Message Reply Date view Thread view Subject view Author view

From: Paul John Rajlich (prajlich++at++ncsa.uiuc.edu)
Date: 07/18/2000 08:55:02


Hi pfPeople,

I'm having problems deleting pfGeoSets in pfLinux. To illustrate
the problem, I've written a small program. The following code behaves
well on my Octane:

int main() {

  pfInit();
  pfMultiprocess(PFMP_DEFAULT);
  pfConfig();

  pfGeode *geode = new pfGeode();

  for (int i=0; i<1000; i++) {
    cout << i << " ";
    cout.flush();
    pfGeoSet *g = pfdNewSphere(10000, pfGetSharedArena());
    geode->addGSet(g);
    geode->removeGSet(geode->getGSet(0));
    delete g;
  }

  pfExit();
  return 0;
}

However, on Linux it fills up the heap. In the Linux version I use
NULL instead of pfGetSharedArena().

I have found that something like this works:

    pfVec3 *verts, *norms;
    pfVec4 *colors;
    ushort *dummy;
    g->getAttrLists(PFGS_COORD3, (void **)&verts, &dummy);
    g->getAttrLists(PFGS_NORMAL3, (void **)&norms, &dummy);
    g->getAttrLists(PFGS_COLOR4, (void **)&colors, &dummy);
    int *lengths = g->getPrimLengths();
    pfFree(pfGetMemory(verts));
    pfFree(pfGetMemory(norms));
    pfFree(pfGetMemory(colors));
    pfFree(pfGetMemory(lengths));

but that's rather painful.

Any ideas?

-Paul

----------------------------------------------------------------------
              Paul J. Rajlich - prajlich++at++ncsa.uiuc.edu
               Visualization and Virtual Environments
           National Center for Supercomputing Applications
               http://brighton.ncsa.uiuc.edu/~prajlich/
----------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jul 18 2000 - 08:55:11 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.