oaMemory
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaMemory 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaMemory 当前在 oapy 中可用的 Python 接口。
详细说明
The oaMemory class is a utility class that encapsulates and adds error checking to the memory management functions, including: malloc , realloc , and free 。 Using these allocation routines instead of new or delete is more efficient on some platforms。
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | _base.oaMemory.get(size) |
| ✅ | _base.oaMemory.resize(ptr, size) |
| ✅ | _base.oaMemory.free(ptr) |
方法说明
_base.oaMemory.get(size)
绑定状态: 已绑定
Python 调用: _base.oaMemory.get(size)
This function gets a block of memory of the specified size in bytes and returns a pointer to it。 The allocation is made by making a call to malloc( ) 。
异常
oacMemGetFailed。
Python 示例
from oapy._oa import _base
_base.oaMemory.get(size)
_base.oaMemory.resize(ptr, size)
绑定状态: 已绑定
Python 调用: _base.oaMemory.resize(ptr, size)
This function resizes a block of memory specified by ptr to the specified size in bytes and returns a pointer to the new block of memory。 The memory is resized by making a call to realloc( ) 。 The contents of the existing memory are unchanged。 Specifying size as zero frees the memory。
异常
oacMemResizeFailed。
Python 示例
from oapy._oa import _base
_base.oaMemory.resize(ptr, size)
_base.oaMemory.free(ptr)
绑定状态: 已绑定
Python 调用: _base.oaMemory.free(ptr)
This function makes memory previously allocated by the get() or resize() functions available for further allocation。
Python 示例
from oapy._oa import _base
_base.oaMemory.free(ptr)