source: branches/profile/ISLAND_HOPPING/mem.h

Last change on this file was 8607, checked in by westram, 7 years ago

merge from e4fix [8135] [8136] [8137] [8138] [8139] [8140] [8141] [8142] [8143] [8144] [8222]
(this revives the reverted patches [8129] [8130] [8131] [8132]; see [8133])

  • fixes
    • some free/delete mismatches
    • wrong definition of ORF objects (Level was no bit value)
    • amino consensus (failed for columns only containing 'C')
  • rename
    • AA_sequence_term → orf_term
    • ED4_sequence_terminal_basic → ED4_abstract_sequence_terminal
  • cleaned up hierarchy dumps
  • tweaked is_terminal()/to_terminal()
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1// ============================================================= //
2//                                                               //
3//   File      : mem.h                                           //
4//   Purpose   :                                                 //
5//                                                               //
6//   Institute of Microbiology (Technical University Munich)     //
7//   http://www.arb-home.de/                                     //
8//                                                               //
9// ============================================================= //
10
11#ifndef MEM_H
12#define MEM_H
13
14#ifndef _STDLIB_H
15#include <stdlib.h>
16#endif
17
18void  *newBlock(size_t s);
19void   freeBlock_(void **v);
20void **newMatrix(size_t nrow,size_t ncol,size_t s);
21void   freeMatrix_(void ***m);
22
23#define newVector(n,s) newBlock((n)*(s))
24
25#define freeBlock(v) freeBlock_((void **)(v))
26
27#define newDoubleVector(n) (double *)(newVector((size_t)(n),sizeof(double)))
28#define newFloatVector(n)  (float *)(newVector((size_t)(n),sizeof(float)))
29#define newShortVector(n)  (short *)(newVector((size_t)(n),sizeof(short)))
30#define newLongVector(n)   (long *)(newVector((size_t)(n),sizeof(long)))
31#define newIntVector(n)    (int *)(newVector((size_t)(n),sizeof(int)))
32#define newCharVector(n)   (char *)(newVector((size_t)(n),sizeof(char)))
33
34#define newDoubleMatrix(r,c) (double **)(newMatrix((size_t)(r),(size_t)(c),sizeof(double)))
35#define newFloatMatrix(r,c) (float **)(newMatrix((size_t)(r),(size_t)(c),sizeof(float)))
36#define newShortMatrix(r,c) (short **)(newMatrix((size_t)(r),(size_t)(c),sizeof(short)))
37#define newLongMatrix(r,c) (long **)(newMatrix((size_t)(r),(size_t)(c),sizeof(long)))
38#define newIntMatrix(r,c) (int **)(newMatrix((size_t)(r),(size_t)(c),sizeof(int)))
39#define newCharMatrix(r,c) (char **)(newMatrix((size_t)(r),(size_t)(c),sizeof(char)))
40#define freeMatrix(m) freeMatrix_((void ***)(m))
41
42#else
43#error mem.h included twice
44#endif // MEM_H
Note: See TracBrowser for help on using the repository browser.