windows porting changes
[csql.git] / src / server / PageInfo.cxx
blob88447634a24f476d6badc8fe8b930866f42c5e13
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 ***************************************************************************/
16 #include<Allocator.h>
17 #include<os.h>
18 #include<Config.h>
20 void PageInfo::setPageAsUsed(size_t offset)
22 isUsed_ = 1;
23 hasFreeSpace_ = 1;
24 nextPage_ = NULL;
25 if (PAGE_SIZE > offset)
26 nextPageAfterMerge_ = NULL;
27 else
28 nextPageAfterMerge_ = ((char*)this)+ offset;
30 void PageInfo::setFirstPageAsUsed()
32 isUsed_ = 1;
33 hasFreeSpace_ = 1;
34 nextPageAfterMerge_ = NULL;
35 nextPage_ = NULL;