| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 #ifndef PPAPI_C_DEV_PPB_MEMORY_DEV_H_ | |
| 6 #define PPAPI_C_DEV_PPB_MEMORY_DEV_H_ | |
| 7 | |
| 8 #include "ppapi/c/pp_stdint.h" | |
| 9 | |
| 10 #define PPB_MEMORY_DEV_INTERFACE_0_1 "PPB_Memory(Dev);0.1" | |
| 11 #define PPB_MEMORY_DEV_INTERFACE PPB_MEMORY_DEV_INTERFACE_0_1 | |
| 12 | 5 |
| 13 /** | 6 /** |
| 14 * @file | 7 * This file defines the <code>PPB_Memory interface</code> for functions |
| 15 * This file defines the PPB_Memory interface defined by the browser and | 8 * related to memory management. |
| 16 * and containing pointers to functions related to memory management. | |
| 17 */ | 9 */ |
| 18 | 10 |
| 19 /** | 11 label Chrome { |
| 20 * @addtogroup Interfaces | 12 M14 = 0.1 |
| 21 * @{ | 13 }; |
| 22 */ | |
| 23 | 14 |
| 24 /** | 15 /** |
| 25 * The PPB_Memory_Dev interface contains pointers to functions related to memory | 16 * The PPB_Memory_Dev interface contains pointers to functions related to memory |
| 26 * management. | 17 * management. |
| 27 * | 18 * |
| 28 */ | 19 */ |
| 29 struct PPB_Memory_Dev { | 20 interface PPB_Memory_Dev { |
| 30 /** | 21 /** |
| 31 * MemAlloc is a pointer to a function that allocate memory. | 22 * MemAlloc is a pointer to a function that allocate memory. |
| 32 * | 23 * |
| 33 * @param[in] num_bytes A number of bytes to allocate. | 24 * @param[in] num_bytes A number of bytes to allocate. |
| 34 * @return A pointer to the memory if successful, NULL If the | 25 * @return A pointer to the memory if successful, NULL If the |
| 35 * allocation fails. | 26 * allocation fails. |
| 36 */ | 27 */ |
| 37 void* (*MemAlloc)(uint32_t num_bytes); | 28 mem_t MemAlloc( |
| 29 [in] uint32_t num_bytes); |
| 38 | 30 |
| 39 /** | 31 /** |
| 40 * MemFree is a pointer to a function that deallocates memory. | 32 * MemFree is a pointer to a function that deallocates memory. |
| 41 * | 33 * |
| 42 * @param[in] ptr A pointer to the memory to deallocate. It is safe to | 34 * @param[in] ptr A pointer to the memory to deallocate. It is safe to |
| 43 * pass NULL to this function. | 35 * pass NULL to this function. |
| 44 */ | 36 */ |
| 45 void (*MemFree)(void* ptr); | 37 void MemFree( |
| 38 [inout] mem_t ptr); |
| 46 }; | 39 }; |
| 47 /** | |
| 48 * @} | |
| 49 */ | |
| 50 | |
| 51 #endif /* PPAPI_C_DEV_PPB_MEMORY_DEV_H_ */ | |
| OLD | NEW |