Ejemplo n.º 1
0
void
Ebase::CommitRecord(EbRecord *pRecord)
{
    EB_ASSERT(pRecord->_lField != NULL);

    // check if there is any modification to the record
    // NOTE for a new record, every field is marked modified
    EbBoolean modified = EB_FALSE;
    for (EbUint32 i=0; i< _dbDef->NumberOfFields(); i++) {
        if (pRecord->_lField[i]._changed == EB_TRUE) {
            modified = EB_TRUE;
        }
    }

    // return if nothing is modified
    if (modified == EB_FALSE) return;

    // check if it is a new record
    if (pRecord->_lField[RECORD_ID_INDEX]._changed == EB_TRUE &&
        *(EbInt32*)pRecord->_lField[RECORD_ID_INDEX]._decodedData ==
        NEW_RECORD_ID) {
        AddNewRecord(pRecord);
    } else {
        ModifyRecord(pRecord);
    }
}
void
JMemoryManager::EmptyStacks()
{
	if (itsMemoryTable != NULL && itsRecursionDepth == 0)
		{
		// Do alloc stack first so dealloc's never have to search through the
		// Alloc stack
		while (theAllocStackSize > 0)
			{
			theAllocStackSize--;
			JMMRecord thisRecord = theAllocStack[theAllocStackSize];

			AddNewRecord(thisRecord);
			}

		while (theDeallocStackSize > 0)
			{
			theDeallocStackSize--;
			DeleteRequest thisRequest = theDeallocStack[theDeallocStackSize];

			DeleteRecord(thisRequest.address, thisRequest.file,
						 thisRequest.line, thisRequest.array);
			}
		}
}