# Why don't we allow stacks to be sparse, instead of forcing them to be contiguous?

DevFeed: [Why don't we allow stacks to be sparse, instead of forcing them to be contiguous?](<https://devfeed.tech/articles/why-don-t-we-allow-stacks-to-be-sparse-instead-of-forcing-them-to-be-contiguous-21757.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20260907-00/?p=112677>)

Author: Raymond Chen

Published: 2026-09-07T14:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [Security](<https://devfeed.tech/topics/security.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [security](<https://devfeed.tech/tags/security.md>), [security-vulnerabilities](<https://devfeed.tech/tags/security-vulnerabilities.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

The article explains why stacks are generally kept contiguous rather than made sparse. It discusses the need for explicit stack-limit checks to prevent stack guard-page hopping, the difficulty of reporting failures when a page in the middle of a stack cannot be committed, and possible changes to x86-32 stack probing to avoid unnecessary page-ins.

## Source excerpt

Imagining how to report a memory allocation failure for a sparse page. The post Why don't we allow stacks to be sparse, instead of forcing them to be contiguous? appeared first on The Old New Thing.