.. efun:: int * query_limits() int * query_limits(int default) :include: Return an array with the current runtime limits, resp. if :arg:`default` is true, the default runtime limits. The entries in the returned array are: int[:macro:`LIMIT_EVAL`]: the max number of eval costs int[:macro:`LIMIT_ARRAY`]: the max number of array entries int[:macro:`LIMIT_MAPPING_SIZE`]: the max number of mapping values int[:macro:`LIMIT_MAPPING_KEYS`]: the max number of mapping entries (:macro:`LIMIT_MAPPING` is an alias for :macro:`LIMIT_MAPPING_KEYS`) int[:macro:`LIMIT_BYTE`]: the max number of bytes handled with one :efun:`read_bytes` or :efun:`write_bytes` call. int[:macro:`LIMIT_FILE`]: the max number of bytes handled with one :efun:`read_file` or :efun:`write_file` call. int[:macro:`LIMIT_CALLOUTS`]: the number of callouts at one time. int[:macro:`LIMIT_COST`]: how to account the current cost. int[:macro:`LIMIT_MEMROY`]: the max. number of bytes which can be *additionally* allocated/used *per top-level execution thread* .. todo:: limit_memroy == typo? For all limits except :macro:`LIMIT_COST` a limit of '0' aka :macro:`LIMIT_UN`:macro:`LIMITED` means 'no limit'. The value for :macro:`LIMIT_COST` has these meanings: value > 0: the execution will cost ``min(value, actual cost)``. value = 0: if the current :macro:`LIMIT_EVAL` is larger than the calling :macro:`LIMIT_EVAL`, the evaluation will cost only 10; otherwise the full cost will be accounted. value < 0: ``(-value)%`` of the current evaluation cost will be accounted; ``-100`` means 'full cost'. .. usage:: :: query_limits() // returns the current runtime limits query_limits(1) // returns the default runtime limits :history 3.2.7 introduced: :history 3.2.9 changed: adds :macro:`LIMIT_CALLOUTS` :history 3.3.563 changed: adds :macro:`LIMIT_COST` :history 3.3.677 changed: adds :macro:`LIMIT_MAPPING_KEYS`, :macro:`LIMIT_MAPPING_SIZE` :history 3.5.0 changed: adds :macro:`LIMIT_MEMORY` .. seealso:: :efun:`limited`, :efun:`set_limits`