void MemDowngradeExclLock(
MemHandle mh); /* handle of affected block */
An application that has an exclusive lock on a block may downgrade it to a shared lock with this routine. It does not otherwise affect the block.
Include: heap.h
void MemFree(
MemHandle mh); /* handle of block to be freed */
This routine frees a global memory block. The block can be locked or unlocked.
Include: heap.h
Warnings: The routine does not care whether other threads have locked the block. If you try to free a bad handle, routine may fatal-error.
word MemGetInfo( /* return value depends on flag passed */
MemHandle mh, /* Handle of block to get info about */
MemGetInfoType info); /* Type of information to get */
MemGetInfo()
is a general-purpose routine for getting information about a global memory block. It gets the information by looking in the block's handle table entry; it does not need to access the actual block. It returns a single word of data; the meaning of that word depends on the value of the
MemGetInfoType
variable passed. The following types are available:
HeapFlags
record for the block. The lower byte is the number of locks currently on the block.
MemDeref()
is preferable.
HM_otherInfo
word. This word is used in different ways for different types of handles.Include: heap.h
Warnings: If the handle is not a global memory block handle, results are unpredictable (the routine will read inappropriate data from the handle table entry).
See Also: MemDeref(),
MemModifyFlags(),
MemModifyOtherInfo(),
HandleModifyOwner().
void MemIncRefCount(
MemHandle mh); /* handle of affected block */
This routine increments the reference count of a global memory block (the reference count is stored in HM
_otherInfo
).
Warnings: This routine assumes that a reference count is stored in HM
_otherInfo
. You may only use this routine if the block has had a reference count set up with
MemInitRefCount()
.
Include: heap.h
void MemInitRefCount(
MemHandle mh, /* handle of affected block */
word count); /* initial reference count */
This routine sets up a reference count for the specified global memory block. The passed count is stored in the HM
_otherInfo
field of the block's handle-table entry.
Warnings: This routine overwrites the HM
_otherInfo
field. Since the semaphore routines (
HandleP()
and
HandleV()
and the routines which use them) use this field, you cannot use both the semaphore routines and the reference count routines on the same block.
Include: heap.h
GEOS SDK TechDocs
|
|
MemAlloc() ...
|
MemLock() ...