~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/mf_sort.cc

  • Committer: Mark Atwood
  • Date: 2011-06-16 06:04:05 UTC
  • mfrom: (2318.4.8 refactor7)
  • Revision ID: me@mark.atwood.name-20110616060405-jqxvti75k6bpq741
mergeĀ lp:~olafvdspek/drizzle/refactor9

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <drizzled/internal/my_sys.h>
21
21
#include <drizzled/internal/m_string.h>
22
22
 
23
 
namespace drizzled
24
 
{
25
 
namespace internal
26
 
{
 
23
namespace drizzled {
 
24
namespace internal {
27
25
 
28
26
void my_string_ptr_sort(unsigned char *base, uint32_t items, size_t size)
29
27
{
30
28
#if INT_MAX > 65536L
31
 
  unsigned char **ptr= NULL;
32
 
 
33
 
  if (size <= 20 && items >= 1000 && items < 100000 &&
34
 
      (ptr= (unsigned char**) malloc(items*sizeof(char*))))
 
29
  if (size <= 20 && items >= 1000 && items < 100000)
35
30
  {
 
31
    unsigned char** ptr= (unsigned char**) malloc(items*sizeof(char*));
36
32
    radixsort_for_str_ptr((unsigned char**) base,items,size,ptr);
37
33
    free((unsigned char*) ptr);
38
34
  }
39
35
  else
 
36
#else
 
37
  assert(false);
40
38
#endif
41
39
  {
42
40
    if (size && items)