Lng32 getTotalTcbSpace(char*inTdb, char * otherInfo, char * parentMemory) { ComTdb * tdb = (ComTdb*)inTdb; Space space(Space::EXECUTOR_SPACE); space.setParent((NAHeap*)parentMemory); // space.setType(Space::SYSTEM_SPACE); // space.setType(Space::EXECUTOR_SPACE); // NAHeap heap("temp heap", NAMemory::DERIVED_FROM_SYS_HEAP); // NAHeap heap("temp heap", NAMemory::EXECUTOR_MEMORY); NAHeap heap("temp heap", (NAHeap*)parentMemory, 32000 /*blocksize*/); ex_globals * g = NULL; switch (tdb->getNodeType()) { // This method is called from an internal CLI call and the only palce // where this internal CLI call is make is from generator for Generator.cpp // for EID Root tdb and so this code is not called for other tdb's case ComTdb::ex_ROOT: g = new(&heap) ExMasterStmtGlobals(10, NULL, NULL, 0, &space, &heap); break; case ComTdb::ex_SPLIT_TOP: g = new(&heap) ExEspStmtGlobals(10, NULL, 0, &space, &heap, NULL, NullFragInstanceHandle, 0); break; case ComTdb::ex_EXPLAIN: break; default: break; } g->setComputeSpace(TRUE); fixupExeVtblPtr(tdb); ex_tcb * tcb = tdb->build(g); fixupComVtblPtr(tdb); Lng32 totalSpaceNeeded = 0; Lng32 tcbSpaceNeeded = 0; Lng32 poolSpaceNeeded = 0; tcbSpaceNeeded = space.getAllocatedSpaceSize(); resetBufSize(tcb, tcbSpaceNeeded, poolSpaceNeeded); // add a 25% fudge factor to TCB space tcbSpaceNeeded = (tcbSpaceNeeded * 125) / 100; totalSpaceNeeded = tcbSpaceNeeded + poolSpaceNeeded; return totalSpaceNeeded; }
///////////////////////////////////////////////////////////// // class ex_tcb ///////////////////////////////////////////////////////////// // Base class constructor ex_tcb::ex_tcb( const ComTdb & tdb, const short in_version, ex_globals * g) : tdb(tdb), nodeType_((ComTdb::ex_node_type)tdb.getNodeType()), version_(in_version), globals_(g), statsEntry_(NULL), pool_(NULL) // QSTUFF , holdable_(FALSE) // QSTUFF { str_cpy_all( (char *) &eyeCatcher_, (char *) &(tdb.eyeCatcher_), 4); #ifdef NA_DEBUG_GUI increaseObjectcount(); setObjectId(); #endif // Cleanup g->registerTcb(this); };