Commit ff43212e authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

DVE2: Minor memory compaction.

* iface/dve2/dve2.cc (dve2_state, dve2_compressed_state): Store
size and count on 16 bits, and hash on 32 bits, to limit memory
wasted.
parent bf8beccc
2011-05-02 Alexandre Duret-Lutz <adl@va-et-vient.net>
DVE2: Minor memory compaction.
* iface/dve2/dve2.cc (dve2_state, dve2_compressed_state): Store
size and count on 16 bits, and hash on 32 bits, to limit memory
wasted.
2011-05-01 Alexandre Duret-Lutz <adl@lrde.epita.fr>
DVE2: Optionally use the new compression.
......
......@@ -74,7 +74,7 @@ namespace spot
struct dve2_state: public state
{
dve2_state(int s, fixed_size_pool* p)
: size(s), count(1), pool(p)
: pool(p), size(s), count(1)
{
}
......@@ -123,17 +123,17 @@ namespace spot
}
public:
int size;
mutable unsigned count;
size_t hash_value;
fixed_size_pool* pool;
size_t hash_value: 32;
int size: 16;
mutable unsigned count: 16;
int vars[0];
};
struct dve2_compressed_state: public state
{
dve2_compressed_state(int s, multiple_size_pool* p)
: size(s), count(1), pool(p)
: pool(p), size(s), count(1)
{
}
......@@ -154,7 +154,7 @@ namespace spot
{
if (--count)
return;
pool->deallocate(this, sizeof(*this) + size * sizeof(int));
pool->deallocate(this, sizeof(*this) + size * sizeof(*vars));
}
size_t hash() const
......@@ -189,10 +189,10 @@ namespace spot
}
public:
int size;
mutable unsigned count;
size_t hash_value;
multiple_size_pool* pool;
size_t hash_value: 32;
int size: 16;
mutable unsigned count: 16;
int vars[0];
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment