1 /* Copyright (c) 2003-2005, 2007 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
17 #include <ndb_global.h>
34 void* NdbMem_Allocate(size_t size
)
38 mem_allocated
= (void*)malloc(size
);
42 void* NdbMem_AllocateAlign(size_t size
, size_t alignment
)
44 (void)alignment
; /* remove warning for unused parameter */
46 return (void*)memalign(alignment, size);
49 return (void*)malloc(size
);
53 void NdbMem_Free(void* ptr
)
59 int NdbMem_MemLockAll(int i
){
62 #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined (MCL_FUTURE)
63 return mlockall(MCL_CURRENT
| MCL_FUTURE
);
68 #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
69 return mlockall(MCL_CURRENT
);
75 int NdbMem_MemUnlockAll(){
76 #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)