Method: Magick.set_cache_threshold

Defined in:
ext/RMagick/rmagick.c

.set_cache_threshold(threshold) ⇒ Object

Set the amount of free memory allocated for the pixel cache. Once this threshold is exceeded, all subsequent pixels cache operations are to/from disk.

Ruby usage:

- @verbatim Magick.set_cache_threshold(megabytes) @endverbatim

Notes:

- singleton method

Parameters:

  • class

    the class on which the method is run.

  • threshold

    the number of megabytes to set.

Returns:

  • the class.



309
310
311
312
313
314
315
316
# File 'ext/RMagick/rmagick.c', line 309

VALUE
Magick_set_cache_threshold(VALUE class, VALUE threshold)
{
    unsigned long thrshld = NUM2ULONG(threshold);
    (void) SetMagickResourceLimit(MemoryResource, (MagickSizeType)thrshld);
    (void) SetMagickResourceLimit(MapResource, (MagickSizeType)(2*thrshld));
    return class;
}