2006-07-29 00:56:54 +00:00
|
|
|
#ifndef ALLOCATION_POLICY_H
|
|
|
|
#define ALLOCATION_POLICY_H
|
|
|
|
|
|
|
|
struct allocationPolicy;
|
|
|
|
typedef struct allocationPolicy allocationPolicy;
|
|
|
|
|
|
|
|
typedef struct availablePage {
|
|
|
|
int freespace;
|
|
|
|
int pageid;
|
2006-08-10 23:39:36 +00:00
|
|
|
int lockCount; // Number of active transactions that have alloced or dealloced from this page.
|
2006-07-29 00:56:54 +00:00
|
|
|
} availablePage;
|
|
|
|
|
|
|
|
allocationPolicy * allocationPolicyInit();
|
2006-08-10 23:39:36 +00:00
|
|
|
void allocationPolicyDeinit(allocationPolicy * ap);
|
2006-07-29 00:56:54 +00:00
|
|
|
void allocationPolicyAddPages(allocationPolicy * ap, availablePage** newPages);
|
|
|
|
availablePage * allocationPolicyFindPage(allocationPolicy * ap, int xid, int freespace);
|
|
|
|
void allocationPolicyTransactionCompleted(allocationPolicy * ap, int xid);
|
|
|
|
void allocationPolicyUpdateFreespaceUnlockedPage(allocationPolicy * ap, availablePage * key, int newFree);
|
|
|
|
void allocationPolicyUpdateFreespaceLockedPage(allocationPolicy * ap, int xid, availablePage * key, int newFree);
|
2006-08-10 23:39:36 +00:00
|
|
|
void allocationPolicyLockPage(allocationPolicy * ap, int xid, int pageid);
|
2006-08-11 03:01:16 +00:00
|
|
|
void allocationPolicyAllocedFromPage(allocationPolicy * ap, int xid, int pageid);
|
2006-07-29 00:56:54 +00:00
|
|
|
#endif // ALLOCATION_POLICY_H
|