~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unique.h

  • Committer: Mark Atwood
  • Date: 2011-12-27 16:09:18 UTC
  • mfrom: (2461.2.1 trunk)
  • Revision ID: me@mark.atwood.name-20111227160918-ai7t6ka9s9xlmlbv
resolve and merge lp:~ivolucien/drizzle/trunk-bug-621861

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
class Unique : public memory::SqlAlloc
41
41
{
42
42
  size_t max_in_memory_size;
43
 
  TREE tree;
 
43
  Tree tree;
44
44
  unsigned char *record_pointers;
45
45
  uint32_t size;
46
46
 
49
49
  Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
50
50
         uint32_t size_arg, size_t max_in_memory_size_arg);
51
51
  ~Unique();
52
 
  ulong elements_in_tree() { return tree.elements_in_tree; }
 
52
  ulong elements_in_tree() { return tree.getElementsInTree(); }
53
53
  inline bool unique_add(void *ptr)
54
54
  {
55
 
    return (not tree_insert(&tree, ptr, 0, tree.custom_arg));
 
55
    return (not tree.tree_insert(ptr, 0, tree.getCustomArg()));
56
56
  }
57
57
 
58
58
  bool get(Table *table);
62
62
                                            size_t sortbuff_size)
63
63
  {
64
64
    register size_t max_elems_in_tree=
65
 
      (1 + sortbuff_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size));
 
65
      (1 + sortbuff_size / ALIGN_SIZE(sizeof(Tree_Element)+key_size));
66
66
    return (int) (sizeof(uint32_t)*(1 + nkeys/max_elems_in_tree));
67
67
  }
68
68