WWFixed MakeWWFixed(number);
This macro casts a floating-point or integer number to a
WWFixed
value.
Include: geos.h
void * malloc(
size_t blockSize); /* # of bytes to allocate*/
The
malloc()
family of routines is provided for Standard C compatibility. If a geode needs a small amount of fixed memory, it can call one of the routines. The kernel will allocate a fixed block to satisfy the geode's
malloc()
requests; it will allocate memory from this block. When the block is filled, it will allocate another fixed malloc-block. When all the memory in the block is freed, the memory manager will automatically free the block.
When a geode calls
malloc()
, a section of memory of the size specified will be allocated out of its malloc-block, and the address of the start of the memory will be returned. The memory will
not
be zero-initialized. If the request cannot be satisfied,
malloc
will return a null pointer. The memory is guaranteed not to be moved until it is freed (with
free()
) or resized (with
realloc()
). When GEOS shuts down, all fixed blocks are freed, and any memory allocated with
malloc()
is lost.
Using too many fixed blocks degrades the memory manager's performance, slowing the whole system. For this reason, applications should not use
malloc
-family routines if they can possibly be avoided. They are provided only to simplify porting of existing programs; however, applications should make every effort to use the GEOS memory management and LMem routines instead. If you must use the
malloc
-family routines, use them sparingly, and free the memory as quickly as possible.
Tips and Tricks: You can allocate memory in another geode's malloc-block by calling
GeoMalloc()
. However, that block will be freed when the other geode exits.
Warnings: All memory allocated with
malloc()
is freed when GEOS shuts down.
Include: stdlib.h
See Also: calloc(),
free(),
GeoMalloc(),
realloc().
word ManufacturerFromFormatID(id);
ClipboardItemFormatID id;
This macro extracts the word-sized manufacturer ID (of type
ManufacturerIDs
) from a
ClipboardInfoFormatID
argument.
GEOS SDK TechDocs
|
|
MailboxGetVMFile() ...
|
MemAlloc() ...