~ubuntu-branches/ubuntu/quantal/zfs-fuse/quantal

« back to all changes in this revision

Viewing changes to src/lib/libumem/umem_test2.c

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey, Mike Hommey, Seth Heeren
  • Date: 2010-06-30 18:03:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100630180352-d3jq25ytbcl23q3y
Tags: 0.6.9-1
* New upstream release.

[ Mike Hommey ]
* debian/control:
  - Build depend on libssl-dev and libattr1-dev, now required to build.
  - Build depend on docbook-xml to avoid xsltproc I/O error loading
    docbook DTD.
  - Add suggestions for a NFS server and kpartx.
* debian/man/*, debian/copyright, debian/rules: Remove manual pages, they
  are now shipped upstream.
* debian/copyright: Change download link.
* src/SConstruct:
  - Add an optim option to the build system.
  - Add support for DESTDIR.
  - Force debug=1 to mean optim, no strip, no debug.
  - Use -ffunction-sections, -fdata-sections, and --gc-sections flags to
    reduce the binary sizes.
* src/lib/libumem/SConscript: Cleanup src/lib/libumem when cleaning up
  build directory.
* src/cmd/*/SConscript: Don't link zfs, zpool and zdb against libssl.
* src/lib/libumem/SConscript: Only build static libumem.
* src/lib/libumem/sol_compat.h:
  - Add atomic cas support for sparc.
  - Use atomic functions from libsolcompat in libumem on unsupported
    platforms.
* debian/rules:
  - Set optimization level in build system according to DEB_BUILD_OPTIONS.
  - Build with debug=1 to have unstripped binaries ; dh_strip will do the
    right thing.
  - Don't depend on the local location of the docbook XSLT stylesheets.
    Use the catalogged url in place of the full path.
  - Don't clean src/.sconsign.dblite and src/path.pyc.
  - Set all destination directories when installing with scons.
  - Install bash completion and zfsrc files.
  - Don't use scons cache when building.
* debian/prerm: Remove /var/lib/zfs/zpool.cache in prerm.
* debian/dirs: Create /etc/bash_completion.d.
* debian/watch: Fix watch file.
* debian/rules, debian/control, debian/compat: Switch to dh.
* debian/README.Debian: Update README.Debian.
* debian/zfs-fuse.man.xml: Update zfs-fuse manual page.
* debian/zfs-fuse.init: Start sharing datasets marked as such at daemon
  startup.
* debian/rules, debian/control: Use config.guess and config.sub from
  autotools-dev.

[ Seth Heeren ]
* debian/zfs-fuse.man.xml:
  Added notes on the precedence, zfsrc, commandline, initscript vs.
  /etc/default/zfs-fuse on some systems.
* debian/zfs-fuse.init, debian/zfs-fuse.default: Deprecating DAEMON_OPTS.
* debian/zfs-fuse.init:
  - Removing import -a -f.
  - Removing the now unnecessary 'sleep 2'.
  - Extended shutdown wait to allow for zfs-fuse daemon's own shutdown
    timeouts.
  - Re-ordered dubious PATH setting.
* debian/zfs-fuse.init: Move existing zpool.cache to new location if
  possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <string.h>
 
3
 
 
4
#include "umem.h"
 
5
 
 
6
static const char *TESTSTRINGS[] = {
 
7
  "fred",
 
8
  "fredfredfred",
 
9
  "thisisabitlongerthantheotherstrings",
 
10
  "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890",
 
11
};
 
12
 
 
13
#define N_TESTSTRINGS (sizeof(TESTSTRINGS) / sizeof(TESTSTRINGS[0]))
 
14
#define N_TESTS 1000
 
15
 
 
16
int
 
17
main (int argc, char *argv[])
 
18
{
 
19
  char *testcases[N_TESTSTRINGS][N_TESTS + 1];
 
20
  size_t len[N_TESTSTRINGS];
 
21
  int i, j;
 
22
 
 
23
  memset(testcases, 0, sizeof(testcases));
 
24
  
 
25
  umem_startup(NULL, 0, 0, NULL, NULL);
 
26
 
 
27
  for (i = 0; i < N_TESTSTRINGS; ++i)
 
28
  {
 
29
    len[i] = strlen(TESTSTRINGS[i]) + 1;
 
30
  }
 
31
 
 
32
  puts("Allocating...");
 
33
 
 
34
  for (j = 0; j < N_TESTS; ++j)
 
35
  {
 
36
    for (i = 0; i < N_TESTSTRINGS; ++i)
 
37
    {
 
38
      testcases[i][j] = umem_alloc(len[i], UMEM_DEFAULT);
 
39
      strcpy(testcases[i][j], TESTSTRINGS[i]);
 
40
    }
 
41
  }
 
42
 
 
43
  puts("Deallocating...");
 
44
 
 
45
  for (j = 0; j < N_TESTS; ++j)
 
46
  {
 
47
    for (i = N_TESTSTRINGS - 1; i >= 0; --i)
 
48
    {
 
49
      umem_free(testcases[i][j], len[i]);
 
50
    }
 
51
 
 
52
    if ((j % 25) == 0)
 
53
    {
 
54
      puts("Reaping...");
 
55
      umem_reap();
 
56
    }
 
57
  }
 
58
 
 
59
  puts("Done");
 
60
 
 
61
  return 0;
 
62
}