| 1 |
/* |
| 2 |
* Copyright (C) 2009 Wayne Meissner |
| 3 |
* |
| 4 |
* This file is part of jffi. |
| 5 |
* |
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 |
* you may not use this file except in compliance with the License. |
| 8 |
* You may obtain a copy of the License at |
| 9 |
* |
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
* |
| 12 |
* Unless required by applicable law or agreed to in writing, software |
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
* See the License for the specific language governing permissions and |
| 16 |
* limitations under the License. |
| 17 |
* |
| 18 |
* |
| 19 |
* Alternatively, you can redistribute it and/or modify it under |
| 20 |
* the terms of the GNU Lesser General Public License as published by |
| 21 |
* the Free Software Foundation, either version 3 of the License, or |
| 22 |
* (at your option) any later version. |
| 23 |
* |
| 24 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
| 25 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 26 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
| 27 |
* for more details. |
| 28 |
* |
| 29 |
* You should have received a copy of the GNU Lesser General Public License |
| 30 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 31 |
*/ |
| 32 |
|
| 33 |
#ifndef JFFI_MEMORY_H |
| 34 |
#define JFFI_MEMORY_H |
| 35 |
|
| 36 |
#ifdef __cplusplus |
| 37 |
extern "C" { |
| 38 |
#endif |
| 39 |
|
| 40 |
int jffi_getPageSize(void); |
| 41 |
void* jffi_allocatePages(int npages); |
| 42 |
bool jffi_freePages(void *addr, int npages); |
| 43 |
bool jffi_makePagesExecutable(void* memory, int npages); |
| 44 |
|
| 45 |
#ifdef __cplusplus |
| 46 |
} |
| 47 |
#endif |
| 48 |
|
| 49 |
#endif |
| 50 |
|