brmem_inquire_cbfn
inquire
member of the br_allocator
99
structure.
typedef
brmem.h
for precise declaration)
br_size_t brmem_inquire_cbfn(br_uint_8) Inquiry function
Class of memory for which information is required. See Memory Classes for a description of possible values.
Specification
Description:
An application defined call-back function providing details of memory availability.CBFnMemInquire()
br_size_t BR_CALLBACK CBFnMemInquire(br_uint_8 type)
br_uint_8 type
BrDiagHandlerSet()
116). BRender has not necessarily completed initialisation. Other allocation handlers may have already been used. BRender is the only direct caller of this function.
Effects: Calculate an estimate of available memory for a particular memory class. This should be the total number of free bytes, irrespective of fragmentation or likely block-header overheads. If the class memory space would be extended, then the estimate should be of the potential maximum size available.
Result:
br_size_t
The total number of bytes remaining unallocated in the specified memory class.
Remarks: This function is only intended to provide an estimate of available memory. It does not guarantee that a particular allocation would succeed (or fail). However, it could be used as an indication of likely success or failure.
There is no relation defined between the values returned for each class. In some allocation schemes, each class may have a separate and fixed amount of memory set aside, whereas in other schemes, all classes may be sharing all memory.
There is no relation defined between the true amount of memory (whether virtual or physical) in a system, and the value returned by this function.
Example: See
stdmem.c
for examples of memory inquiry functions.See Also:
CBFnMemAllocate()
383
, CBFnMemFree()
385
.