extern C void SECTION(".entry") _entry() { int ret, argc; char *arguments; char **argv; /* Setup the heap, C++ constructors and default mounts. */ setupHeap(); runConstructors(); setupMappings(); /* Allocate buffer for arguments. */ argc = 0; argv = (char **) new char[ARGV_COUNT]; arguments = (char *) ARGV_ADDR; /* Fill in arguments list. */ while (argc < ARGV_COUNT && *arguments) { argv[argc] = arguments; arguments += ARGV_SIZE; argc++; } /* Pass control to the program. */ ret = main(argc, argv); /* Terminate execution. */ runDestructors(); exit(ret); }
/** * @see PhysicalOperator::execute */ shared_ptr<Array> execute(vector< shared_ptr<Array> >& inputArrays, shared_ptr<Query> query) { assert(inputArrays.size() == 1); shared_ptr<Array>& srcArray = inputArrays[0]; ArrayDesc const& srcArrayDesc = srcArray->getArrayDesc(); Attributes const& destAttrs = _schema.getAttributes(true); // true = exclude empty tag. Dimensions const& destDims = _schema.getDimensions(); vector<AggregatePtr> aggregates (destAttrs.size()); vector<size_t> attrMapping(destAttrs.size()); vector<size_t> dimMapping(_schema.getDimensions().size()); setupMappings(srcArrayDesc, aggregates, attrMapping, dimMapping, destAttrs, destDims); ElapsedMilliSeconds timing; RedistributeMode redistributeMode(AUTO); if (haveAggregatesOrSynthetic(srcArrayDesc)) { //XXX TODO: until redistributeAggregate() is cut over to pullRedistribute(), // the aggreagted SG does not enforce data integrity redistributeMode = AGGREGATED; } else if ( isStrict()) { redistributeMode = VALIDATED; } return redimensionArray(srcArray, attrMapping, dimMapping, aggregates, query, timing, redistributeMode); }