Both will allocate continuous virtual memory. Suppose you are using a system in which swap is used as virtual memory management. The first ten words can be highlighted at the end of the page frame, and the last ten will be highlighted at the beginning of another page frame. The physical distribution of pages depends on the kernel, and not on the implementation of {m|c}alloc() . They will simply ask for more memory through a system call (see brk() , mmap() ). Since the physical distribution of page frames is not necessarily contiguous, you get one part of your distribution that falls on one page and the other on another.
In most cases, you just donβt need to worry about whether your data will intersect with the page border if you are not looking for optimization and you want to avoid excessive minor errors.
source share