BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):brmem_inquire_cbfn
Next|Prev|Up
The Call-Back Function
Specification
CBFnMemInquire()

brmem_inquire_cbfn


The Call-Back Function

This type defines a memory inquiry function, primarily intended for the inquire member of the br_allocator
99 structure.

The typedef

(See brmem.h for precise declaration)

br_size_t brmem_inquire_cbfn(br_uint_8) Inquiry function

Specification


CBFnMemInquire()

Description:
An application defined call-back function providing details of memory availability.

Declaration:
br_size_t BR_CALLBACK CBFnMemInquire(br_uint_8 type)

Arguments:
br_uint_8 type

Class of memory for which information is required. See Memory Classes for a description of possible values.

Preconditions:
The diagnostic handler has been setup (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.



Generated with CERN WebMaker