source: eaccelerator/trunk/mm.h @ 176

Revision 176, 3.4 KB checked in by bart, 5 years ago (diff)

The nigthly cvs tarballs of sf aren't that nigthly at all. The commits from
march weren't included.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2   +----------------------------------------------------------------------+
3   | eAccelerator project                                                 |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 2004 - 2006 eAccelerator                               |
6   | http://eaccelerator.net                                              |
7   +----------------------------------------------------------------------+
8   | This program is free software; you can redistribute it and/or        |
9   | modify it under the terms of the GNU General Public License          |
10   | as published by the Free Software Foundation; either version 2       |
11   | of the License, or (at your option) any later version.               |
12   |                                                                      |
13   | This program is distributed in the hope that it will be useful,      |
14   | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
15   | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
16   | GNU General Public License for more details.                         |
17   |                                                                      |
18   | You should have received a copy of the GNU General Public License    |
19   | along with this program; if not, write to the Free Software          |
20   | Foundation, Inc., 59 Temple Place - Suite 330, Boston,               |
21   | MA  02111-1307, USA.                                                 |
22   |                                                                      |
23   | A copy is availble at http://www.gnu.org/copyleft/gpl.txt            |
24   +----------------------------------------------------------------------+
25   $Id$
26*/
27
28/* libmm replacement */
29
30#ifndef INCLUDED_MM_H
31#define INCLUDED_MM_H
32
33#include <sys/types.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#ifndef MM_PRIVATE
40#  ifdef MM
41#    undef MM
42#  endif
43#  define MM void
44#endif
45
46#define MM_LOCK_RW 1
47#define MM_LOCK_RD 0
48
49#if (_MSC_VER < 1400)
50MM*    _mm_create(size_t size, const char* key);
51void   _mm_set_attach(MM* mm, void* attach_addr);
52void*  _mm_attach(size_t size, const char* key);
53size_t _mm_size(MM* mm);
54void   _mm_destroy(MM* mm);
55int    _mm_lock(MM* mm, int kind);
56int    _mm_unlock(MM* mm);
57size_t _mm_available(MM* mm);
58size_t _mm_maxsize(MM* mm);
59void*  _mm_malloc_lock(MM* mm, size_t size);
60void   _mm_free_lock(MM* mm, void* p);
61void*  _mm_malloc_nolock(MM* mm, size_t size);
62void   _mm_free_nolock(MM* mm, void* p);
63size_t _mm_sizeof(MM* mm, void* x);
64#endif
65
66
67const char* mm_shm_type();
68const char* mm_sem_type();
69
70#define MM_PROT_NONE  1
71#define MM_PROT_READ  2
72#define MM_PROT_WRITE 4
73#define MM_PROT_EXEC  8
74
75int mm_protect(MM* mm, int mode);
76
77#if (_MSC_VER < 1400)
78#define mm_create(A, B)        _mm_create(A, B)
79#define mm_set_attach(A, B)    _mm_set_attach(A, B)
80#define mm_attach(A, B)        _mm_attach(A, B)
81#define mm_size(A)             _mm_size(A)
82#define mm_destroy(A)          _mm_destroy(A)
83#define mm_lock(A, B)          _mm_lock(A, B)
84#define mm_unlock(A)           _mm_unlock(A)
85#define mm_available(A)        _mm_available(A)
86#define mm_maxsize(A)          _mm_maxsize(A)
87#define mm_malloc_lock(A, B)   _mm_malloc_lock(A, B)
88#define mm_free_lock(A, B)     _mm_free_lock(A, B)
89#define mm_malloc_nolock(A, B) _mm_malloc_nolock(A, B)
90#define mm_free_nolock(A, B)   _mm_free_nolock(A, B)
91#define mm_sizeof(A, B)        _mm_sizeof(A, B)
92#endif
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
Note: See TracBrowser for help on using the repository browser.