mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-24 02:03:52 +03:00
- Fix memory leak in Scheduler - Optimize BitMap
This commit is contained in:
parent
b749757934
commit
4756ef9d1b
@ -137,7 +137,7 @@ public:
|
||||
{
|
||||
if ( hint != 0 )
|
||||
{
|
||||
if ( bs->test(hint) == false && reserved_bit.count(hint) == 0 )
|
||||
if ( !bs->test(hint) && !reserved_bit.test(hint) )
|
||||
{
|
||||
bs->set(hint);
|
||||
|
||||
@ -150,7 +150,7 @@ public:
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( bs->test(bit) == false && reserved_bit.count(bit) == 0)
|
||||
if ( !bs->test(bit) && !reserved_bit.test(bit) )
|
||||
{
|
||||
bs->set(bit);
|
||||
return 0;
|
||||
@ -217,7 +217,7 @@ private:
|
||||
|
||||
unsigned int start_bit;
|
||||
|
||||
std::set<unsigned int> reserved_bit;
|
||||
std::bitset<N> reserved_bit;
|
||||
|
||||
std::bitset<N> * bs;
|
||||
|
||||
@ -365,9 +365,9 @@ private:
|
||||
continue;
|
||||
}
|
||||
|
||||
for (bit = bit_start; bit <= bit_end; bit++)
|
||||
for (bit = bit_start; bit <= bit_end && bit < N; bit++)
|
||||
{
|
||||
reserved_bit.insert(bit);
|
||||
reserved_bit.set(bit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ private:
|
||||
/**
|
||||
* The associated vector attribute
|
||||
*/
|
||||
VectorAttribute * va;
|
||||
std::unique_ptr<VectorAttribute> va;
|
||||
|
||||
/**
|
||||
* Set the VMS attribute for the role (list of VM IDs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user