Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fix bug in setting the mmap size
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e9d74ac51edeb1da0923449d9d2a02c13c467ecd
User & Date: brandon 2016-05-27 19:36:13
Context
2016-05-27
19:38
use a more sensible default memmap size (128kb) check-in: 1a645986ae user: brandon tags: trunk
19:36
fix bug in setting the mmap size check-in: e9d74ac51e user: brandon tags: trunk
19:26
fix bug in setting the number of buckets check-in: f617f59f6b user: brandon tags: trunk
Changes

Changes to src/zdbc.c.

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
parse_opt (int key, char *arg, struct argp_state *state)
{
  struct arguments *arguments = state->input;
  unsigned long int size;
  switch (key)
    {
    case 'b':
      size = arg ? strtoul (arg, NULL, 10) : 100L;
      if (size > SIZE_MAX || size <= 0)
        {
          arguments->num_buckets = SIZE_MAX;
        }
      else
        {
          arguments->num_buckets = (size_t)size;
        }
      break;
    case 'l':
      arguments->no_lock = true;
      break;
    case 'm':
      size = arg ? strtoul (arg, NULL, 10) : 1024;
      if (size > sizeof(size_t) || size <= 0)
        {
          arguments->mmap_size = sizeof(size_t);
        }
      else
        {
          arguments->mmap_size = (size_t)size;
        }
      break;
#ifdef HAVE_GDBM







|
|













|

|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
parse_opt (int key, char *arg, struct argp_state *state)
{
  struct arguments *arguments = state->input;
  unsigned long int size;
  switch (key)
    {
    case 'b':
      size = arg ? strtoul (arg, NULL, 10) : 100UL;
      if (size > SIZE_MAX)
        {
          arguments->num_buckets = SIZE_MAX;
        }
      else
        {
          arguments->num_buckets = (size_t)size;
        }
      break;
    case 'l':
      arguments->no_lock = true;
      break;
    case 'm':
      size = arg ? strtoul (arg, NULL, 10) : 1024;
      if (size > SIZE_MAX)
        {
          arguments->mmap_size = SIZE_MAX;
        }
      else
        {
          arguments->mmap_size = (size_t)size;
        }
      break;
#ifdef HAVE_GDBM