+ /* There's a mysterious Solaris/x86 problem with using mmap
+ * tricks for memory zeroing. See sbcl-devel thread
+ * "Re: patch: standalone executable redux".
+ *
+ * Since pages don't have to be zeroed ahead of time, only do
+ * so when called from purify.
+ */
+#if defined(LISP_FEATURE_SUNOS)
+ if (forcibly)
+ zero_pages(from, to);
+#else
+ page_index_t aligned_from, aligned_end, end = to+1;
+
+ const page_index_t
+ release_granularity = gencgc_release_granularity/GENCGC_CARD_BYTES,
+ release_mask = release_granularity-1,
+ end = to+1,
+ aligned_from = (from+release_mask)&~release_mask,
+ aligned_end = (end&~release_mask);
+
+ if (aligned_from < aligned_end) {
+ zero_pages_with_mmap(aligned_from, aligned_end-1);
+ if (forcibly) {
+ if (aligned_from != from)
+ zero_pages(from, aligned_from-1);
+ if (aligned_end != end)
+ zero_pages(aligned_end, end-1);
+ }
+ } else if (forcibly)
+ zero_pages(from, to);
+#endif
+}