~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global_buffer.h

  • Committer: Andrew Hutchings
  • Date: 2010-10-22 13:52:10 UTC
  • mto: This revision was merged to the branch mainline in revision 1907.
  • Revision ID: andrew@linuxjedi.co.uk-20101022135210-puqqk8yg94cshbg4
Change default setting
Don't allow it to be less than sort-buffer-size
Move to pre-alloc for sort buffer

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class global_buffer_constraint
29
29
{
30
30
public:
31
 
  global_buffer_constraint(T max) :
32
 
    max_size(max)
33
 
  {  }
 
31
  global_buffer_constraint(T max)
 
32
  {
 
33
    setMaxSize(max); 
 
34
  }
34
35
 
35
36
  T getMaxSize() const { return max_size; }
36
 
  void setMaxSize(T new_size) { max_size= new_size; }
 
37
  void setMaxSize(T new_size) 
 
38
  {
 
39
    if (new_size == 0) new_size = std::numeric_limits<T>::max(); 
 
40
    max_size= new_size;
 
41
  }
37
42
 
38
43
  bool add(T addition)
39
44
  {