RISCOS.com

www.riscos.com Technical Support:
Acorn C/C++

 

The ANSI library


The ANSI library is a stand-alone version of the shared C library that contains a few extra functions useful in debugging and profiling your code. You should use it for development only, using the shared C library in any final product.

This chapter describes the extra functions provided by the ANSI library. For details of the other functions, see the chapter entitled The C library.



Extra functions

__heap_checking_on_all_allocates
__heap_checking_on_all_deallocates

void __heap_checking_on_all_allocates (int on);
void __heap_checking_on_all_deallocates (int on);

Calling these functions with a non-zero argument causes malloc() and free() respectively to check the consistency of the C heap on every call, rather than only when the heap is coalesced. It is especially useful for tracking down exactly where memory corruption is occurring. This feature is disabled by passing an argument of zero.

_mapstore
_fmapstore

void _mapstore (void);
void _fmapstore (char *filename);

These functions write profiling information for a program to stderr or filename respectively, if the program has been compiled with profiling enabled.

© 3QD Developments Ltd 2013