Link Search Menu Expand Document

Compilation

The DeLaFitsDefine include file contains DeLaFits compiler directives. Most of them are defined automatically depending on the toolchain and platform. Others have default values, but you can change them.

Memory manager

DeLaFits uses an intermediate Buffer for reading and writing operations. You can define methods for creating and releasing memory for this Buffer.

  • {$DELA_MEMORY_SHARED} − all Containers use a share Buffer. This directive will increase the performance of successive operations with a series of Containers and will reduce memory fragmentation. But this case leads to known problems in a multi-threaded application: read and write operations must be synchronized.

  • {$DELA_MEMORY_PRIVATE} − each Container works with a private Buffer. This directive allows using Container instances on different threads but boosts consumption and memory fragmentation proportion to the number of Container instances.

  • {$DELA_MEMORY_TEMP} − each Container creates a local Buffer as needed and frees it immediately after use. In this case, memory is used sparingly, is thread-safe, but becomes fragmented and slows the intensive read and write operations. Use this directive when the number of Container instances in the application is limited, or read and write operations are not performed often.

{$DELA_MEMORY_SHARED} directive set by default.

NaN math

By default, the {$DELA_MATH_NAN} directive is defined, which allows correctly processing data with NaN values. It slows down read and write operations. If your dataset does not have NaN values, you can turn off this mode using the {$DELA_MATH_NAN_OFF} directive.

Pseudorandom number generator

To customize a pseudorandom number generator, define the {$DELA_CUSTOM_RANDOM} directive and use the DeLaFitsMath.SetCustomRandom() procedure. Useful for unit testing. Turn off by default: DeLaFits uses a generator from the standard library.

Round render

{$DELA_ROUND_RENDER} directive enables the rounding of pixel value when rendering an IMAGE extention. Useful for unit testing. Turn off by default.