M4RI
1.0.1
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
mmc.h
Go to the documentation of this file.
1
9
#ifndef M4RI_MMC_H
10
#define M4RI_MMC_H
11
12
/*******************************************************************
13
*
14
* M4RI: Linear Algebra over GF(2)
15
*
16
* Copyright (C) 2007, 2008 Gregory Bard <bard@fordham.edu>
17
* Copyright (C) 2008 Martin Albrecht <M.R.Albrecht@rhul.ac.uk>
18
*
19
* Distributed under the terms of the GNU General Public License (GPL)
20
* version 2 or higher.
21
*
22
* This code is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
* General Public License for more details.
26
*
27
* The full text of the GPL is available at:
28
*
29
* http://www.gnu.org/licenses/
30
*
31
********************************************************************/
32
33
#include "
misc.h
"
34
35
void
*m4ri_mmc_malloc(
size_t
size);
36
void
m4ri_mmc_free(
void
*condemned,
size_t
size);
37
void
m4ri_mmc_cleanup(
void
);
38
42
#define __M4RI_ENABLE_MMC
43
47
#define __M4RI_MMC_NBLOCKS 16
48
52
#define __M4RI_MMC_THRESHOLD __M4RI_CPU_L2_CACHE
53
57
typedef
struct
_mm_block
{
61
size_t
size
;
62
66
void
*
data
;
67
68
}
mmb_t
;
69
78
static
inline
void
*
m4ri_mmc_calloc
(
size_t
count,
size_t
size) {
79
size_t
total_size = count * size;
80
void
*ret = m4ri_mmc_malloc(total_size);
81
memset((
char
*)ret, 0, total_size);
82
return
ret;
83
}
84
85
#endif // M4RI_MMC_H
Generated on Fri Jul 27 2012 19:21:28 for M4RI by
1.8.1.1