Border file up to 32G (was 4).
This commit is contained in:
parent
c1497d3cd2
commit
4c488dd556
|
@ -43,7 +43,7 @@ void BorderServer::AddBorder(unsigned short _size, unsigned int used) {
|
||||||
entry.used = used;
|
entry.used = used;
|
||||||
entry.links = NULL;
|
entry.links = NULL;
|
||||||
push_back(entry);
|
push_back(entry);
|
||||||
Redim(entry.start * sizeof(Link) + _size * sizeof(Link));
|
Redim((int64)entry.start * (int64)sizeof(Link) + (int64)_size * (int64)sizeof(Link));
|
||||||
}
|
}
|
||||||
|
|
||||||
Border &BorderServer::GetBorder(unsigned int border, bool flush) {
|
Border &BorderServer::GetBorder(unsigned int border, bool flush) {
|
||||||
|
@ -84,7 +84,7 @@ void BorderServer::ResizeBorder(unsigned int border, unsigned int used) {
|
||||||
capacity = entry.size * 2;
|
capacity = entry.size * 2;
|
||||||
|
|
||||||
unsigned int newstart = Length()/sizeof(Link);
|
unsigned int newstart = Length()/sizeof(Link);
|
||||||
Redim((newstart + capacity) * sizeof(Link));
|
Redim((int64)(newstart + capacity) * (int64)sizeof(Link));
|
||||||
Link *newlinks = new Link[capacity];
|
Link *newlinks = new Link[capacity];
|
||||||
if(entry.used > 0) {
|
if(entry.used > 0) {
|
||||||
assert(entry.links);
|
assert(entry.links);
|
||||||
|
@ -103,8 +103,8 @@ void BorderServer::FlushBorder(unsigned int border) {
|
||||||
Border &entry = operator[](border);
|
Border &entry = operator[](border);
|
||||||
//assert(entry.links);
|
//assert(entry.links);
|
||||||
if(entry.size && !MFile::IsReadOnly()) { //write back patch
|
if(entry.size && !MFile::IsReadOnly()) { //write back patch
|
||||||
MFile::SetPosition((int64)entry.start * sizeof(Link));
|
MFile::SetPosition((int64)entry.start * (int64)sizeof(Link));
|
||||||
MFile::WriteBuffer(entry.links, entry.used * sizeof(Link));
|
MFile::WriteBuffer(entry.links, entry.used * (int64)sizeof(Link));
|
||||||
}
|
}
|
||||||
if(entry.links)
|
if(entry.links)
|
||||||
delete [](entry.links);
|
delete [](entry.links);
|
||||||
|
@ -114,10 +114,10 @@ void BorderServer::FlushBorder(unsigned int border) {
|
||||||
|
|
||||||
Link *BorderServer::GetRegion(unsigned int start, unsigned int size) {
|
Link *BorderServer::GetRegion(unsigned int start, unsigned int size) {
|
||||||
if(size == 0) return NULL;
|
if(size == 0) return NULL;
|
||||||
SetPosition((int64)start * sizeof(Link));
|
SetPosition((int64)start * (int64)sizeof(Link));
|
||||||
Link *buf = new Link[size];
|
Link *buf = new Link[size];
|
||||||
assert(buf);
|
assert(buf);
|
||||||
ReadBuffer(buf, size * sizeof(Link));
|
ReadBuffer(buf, (int64)size * (int64)sizeof(Link));
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue