~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unique.h

  • Committer: lbieber
  • Date: 2010-09-11 00:47:34 UTC
  • mfrom: (1756.1.2 build)
  • Revision ID: lbieber@orisndriz03-20100911004734-m5kvdu6q2nq0u43w
Merge Brian - cppcheck fixes and also modifies unique lookup such that we let the OS handle paging for unique checking (instead of trying to mimic it through using a self built IO_CACHE).
Merge Andrew - fix test result for embedded_innodb 

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
class Unique : public memory::SqlAlloc
42
42
{
43
 
  DYNAMIC_ARRAY file_ptrs;
44
 
  ulong max_elements;
45
43
  size_t max_in_memory_size;
46
 
  internal::IO_CACHE *file;
47
44
  TREE tree;
48
45
  unsigned char *record_pointers;
49
 
  bool flush();
50
46
  uint32_t size;
51
47
 
52
48
public:
57
53
  ulong elements_in_tree() { return tree.elements_in_tree; }
58
54
  inline bool unique_add(void *ptr)
59
55
  {
60
 
    if (tree.elements_in_tree > max_elements && flush())
61
 
      return(1);
62
 
    return(!tree_insert(&tree, ptr, 0, tree.custom_arg));
 
56
    return (not tree_insert(&tree, ptr, 0, tree.custom_arg));
63
57
  }
64
58
 
65
59
  bool get(Table *table);