2 extern int classsize[];
4 //NOTE: "pile" ptr points to the head of the linked list of the machine pile data structures
6 /* This function creates a new pile data structure to hold
7 * obj ids of objects modified or read inside a transaction,
8 * no of objects read and no of objects modified
9 * that belong to a single machine */
11 plistnode_t *pCreate(int objects) {
14 //Create main structure
15 if((pile = calloc(1, sizeof(plistnode_t))) == NULL) {
16 printf("Calloc error %s %d\n", __FILE__, __LINE__);
19 if ((pile->oidmod = calloc(objects, sizeof(unsigned int))) == NULL) {
20 printf("Calloc error %s %d\n", __FILE__, __LINE__);
24 if ((pile->oidcreated = calloc(objects, sizeof(unsigned int))) == NULL) {
25 printf("Calloc error %s %d\n", __FILE__, __LINE__);
30 if ((pile->objread = calloc(objects, sizeof(unsigned int) + sizeof(short))) == NULL) {
31 printf("Calloc error %s %d\n", __FILE__, __LINE__);
34 free(pile->oidcreated);
38 pile->nummod = pile->numread = pile->numcreated = pile->sum_bytes = pile->mid = 0;
43 //Count the number of machine piles
44 int pCount(plistnode_t *pile) {
55 //Make a list of mid's for each machine group
56 int pListMid(plistnode_t *pile, unsigned int *list) {
68 //Delete the entire pile
69 void pDelete(plistnode_t *pile) {
70 plistnode_t *next, *tmp;
75 free(tmp->oidcreated);