The DP4 library contains a number of memory management functions that can give improved performance. They fall into three categories which are described in this Section:
The heap management functions implement a 'cheap', efficient heap. Except on legacy platforms there is little reason to use these functions directly, although the cache and buffered fetch functions use them internally- the ANSI heap routines will work just as well or better.
The caching functions allow frequently used records to be retrieved from memory rather than from the database server
The buffered fetch functions read multiple records when accessing access to the database server. Because these functions markedly reduce the number of application calls to the DBMS, they are well suited to achieve performance gains on networked systems. In fact they can considerably improve performance even when the database is accessed locally, partly by reducing the amount of IPC between the application and the DBMS, and partly because the DBMS can optimise certain operations when it knows it has to fetch multiple records at the same time.
DP4 also has two families of functions for reading and writing files. They differ only in whether the file in question is accessed via the database manager , hence possibly on a remote machine, (the sf_() familiy of functions) or locally via the terminal manager, the (tf_() familiy). These functions use DP4's own file caching mechanism in those programs, which can improve performance (though this is less of a consideration on modern operating systems.)
Traditionally several of these functions used or returned quantities that were of type long, and then unsigned long, which meant they did not work with very large files or disks. As of release 4.622 both 32 bit and 64 bit versions of all these functions are available. In this manual such parameters or return types are all described as file_pointer. You can enable the 64 bit version of the functions by including the following #define in your C code becore including dp4capi.h:
#define USE_DP5_FILEHANDLING 1