Core: Bits optimized, CtrlLib: ArrayCtrl::WhenColumnSort

git-svn-id: svn://ultimatepp.org/upp/trunk@11029 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-04-25 10:37:55 +00:00
parent 647b4ee789
commit ce7186cd36
6 changed files with 36 additions and 30 deletions

View file

@ -83,4 +83,26 @@ thread__ int invector_cache_blki_;
thread__ int invector_cache_offset_;
thread__ int invector_cache_end_;
void Bits::Clear()
{
if(bp)
delete[] bp;
alloc = 0;
bp = NULL;
}
void Bits::Expand(int q)
{
int nalloc = 4 * q / 3 + 1;
dword *nbp = new dword[nalloc];
if(bp) {
Copy(nbp, bp, bp + alloc);
delete[] bp;
}
Fill(nbp + alloc, nbp + nalloc, (dword)0);
bp = nbp;
alloc = nalloc;
}
}