-/* Function to call to issue a warning;
- 0 means don't issue them. */
-static void (*warnfunction) ();
-
-static void
-check_memory_limits (address)
- POINTER address;
-{
- SIZE data_size = address - data_space_start;
-
- switch (warnlevel)
- {
- case 0:
- if (data_size > (lim_data / 4) * 3)
- {
- warnlevel++;
- (*warnfunction) ("Warning: past 75% of memory limit");
- }
- break;
-
- case 1:
- if (data_size > (lim_data / 20) * 17)
- {
- warnlevel++;
- (*warnfunction) ("Warning: past 85% of memory limit");
- }
- break;
-
- case 2:
- if (data_size > (lim_data / 20) * 19)
- {
- warnlevel++;
- (*warnfunction) ("Warning: past 95% of memory limit");
- }
- break;
-
- default:
- (*warnfunction) ("Warning: past acceptable memory limits");
- break;
- }
-
- if (EXCEEDS_ELISP_PTR (address))
- memory_full ();
-}
-\f