Link Search Menu Expand Document

Compilation

The include file DeLaFitsDefine contains the conditional compilation directives for DeLaFits. 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 read and write operations. You can determine how memory for this buffer will be allocated and freed.

  • {$DELAFITS_MEMORY_SHARED} − all TFitsContainer instances use a shared buffer. This directive enhances the performance of read and write operations while also reducing memory fragmentation. However, in this case, read and write operations in multithreaded applications must be synchronized.

  • {$DELAFITS_MEMORY_OBJECT} − each TFitsContainer instance operates with its own buffer. Increases memory usage and fragmentation proportional to the number of TFitsContainer instances. Work with TFitsContainer instances in different threads (not tested).

  • {$DELAFITS_MEMORY_LOCAL} − each TFitsContainer instance creates a temporary buffer as needed and frees it immediately after use. Memory is used sparingly, but fragmentation increases, and read and write performance may decrease. Work with TFitsContainer instances in different threads (not tested).

{$DELAFITS_MEMORY_SHARED} directive set by default.

NaN math

By default, the {$DELAFITS_MATH_NAN} directive is defined, which allows working with NaN values. This slows down read and write operations. If your TFitsContainer instances do not contain NaN values, you can disable this behavior using the {$DELAFITS_MATH_NAN_OFF} directive.

Pseudorandom number generator

To customize a pseudorandom number generator, define the {$DELAFITS_CUSTOM_RANDOM} directive and use the DeLaFitsMath.SetCustomRandom procedure. Useful for unit testing. By default, the directive is not defined; DeLaFits uses the generator from the standard library.

Round render

{$DELAFITS_ROUND_RENDER} directive enables the rounding of pixel value when rendering an IMAGE extension. Useful for unit testing. By default, the directive is not defined.