source: branches/stable/CONSENSUS_TREE/CT_mem.cxx

Last change on this file was 8470, checked in by westram, 8 years ago
  • various refactorings (performed while digging for non-determinism)
    • use references to pointers for functions which transfer ownership (and NULL the originating pointer). done in hash_insert, part_free, new_ntnode, ins_ntree, insert_ntree
    • removed unused 'ntree_count'
  • fixed a bug in part_size
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 301 bytes
1// memory handling
3#include <cstdlib>
4#include <cstring>
5#include <cstdio>
7void *getmem(size_t size) {
8    void *p = malloc(size);
9    if (!p) {
10        fprintf(stderr, "Error occurred in Module CONSENSUS! Not enough Memory left\n");
11        return 0;
12    }
14    memset(p, 0, size);
15    return p;
Note: See TracBrowser for help on using the repository browser.