diff options
author | Josh Blum | 2013-01-31 12:39:09 -0800 |
---|---|---|
committer | Josh Blum | 2013-01-31 12:39:09 -0800 |
commit | 28a1850a27179952293c64b0c67e8ed56fb76f84 (patch) | |
tree | 91c3976b5b085bd205e68983322a2bda2e6db443 /lib/block_allocator.cpp | |
parent | 8242e504d5113a54010eb5863c01b0e0f4cedd74 (diff) | |
download | sandhi-28a1850a27179952293c64b0c67e8ed56fb76f84.tar.gz sandhi-28a1850a27179952293c64b0c67e8ed56fb76f84.tar.bz2 sandhi-28a1850a27179952293c64b0c67e8ed56fb76f84.zip |
gras: misc tweaks to alloc sizes
Diffstat (limited to 'lib/block_allocator.cpp')
-rw-r--r-- | lib/block_allocator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/block_allocator.cpp b/lib/block_allocator.cpp index edac4c6..c1ef827 100644 --- a/lib/block_allocator.cpp +++ b/lib/block_allocator.cpp @@ -7,9 +7,9 @@ using namespace gras; -const size_t AT_LEAST_DEFAULT_ITEMS = 1 << 13; +const size_t AT_LEAST_BYTES = 1 << 14; const size_t AHH_TOO_MANY_BYTES = 1 << 20; //TODO -const size_t THIS_MANY_BUFFERS = 32; +const size_t THIS_MANY_BUFFERS = 16; void BlockActor::buffer_returner(const size_t index, SBuffer &buffer) { @@ -50,6 +50,8 @@ static size_t recommend_length( return Nmin_bytes; } +#define my_round_up_mult(num, mult) (((num)*(mult))+(mult)-1)/(mult) + void BlockActor::handle_top_alloc(const TopAllocMessage &, const Theron::Address from) { MESSAGE_TRACER(); @@ -60,7 +62,7 @@ void BlockActor::handle_top_alloc(const TopAllocMessage &, const Theron::Address { const size_t bytes = recommend_length( this->output_allocation_hints[i], - AT_LEAST_DEFAULT_ITEMS*this->output_items_sizes[i], + my_round_up_mult(AT_LEAST_BYTES, this->output_items_sizes[i]), this->output_configs[i].reserve_items*this->output_items_sizes[i], this->output_configs[i].maximum_items*this->output_items_sizes[i] ); |