1 |
/* Buffer manipulation primitives for GNU Emacs. |
/* Buffer manipulation primitives for GNU Emacs. |
2 |
Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001 |
Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 2002 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
4343 |
|
|
4344 |
#define MEM_ALIGN sizeof (double) |
#define MEM_ALIGN sizeof (double) |
4345 |
|
|
4346 |
|
/* Predicate returning true if part of the address range [START .. |
4347 |
|
END[ is currently mapped. Used to prevent overwriting an existing |
4348 |
|
memory mapping. |
4349 |
|
|
4350 |
|
Default is to conservativly assume the address range is occupied by |
4351 |
|
something else. This can be overridden by system configuration |
4352 |
|
files if system-specific means to determine this exists. */ |
4353 |
|
|
4354 |
|
#ifndef MMAP_ALLOCATED_P |
4355 |
|
#define MMAP_ALLOCATED_P(start, end) 1 |
4356 |
|
#endif |
4357 |
|
|
4358 |
/* Function prototypes. */ |
/* Function prototypes. */ |
4359 |
|
|
4360 |
static int mmap_free_1 P_ ((struct mmap_region *)); |
static int mmap_free_1 P_ ((struct mmap_region *)); |
4447 |
} |
} |
4448 |
else if (npages > 0) |
else if (npages > 0) |
4449 |
{ |
{ |
|
struct mmap_region *r2; |
|
|
|
|
4450 |
nbytes = npages * mmap_page_size; |
nbytes = npages * mmap_page_size; |
4451 |
|
|
4452 |
/* Try to map additional pages at the end of the region. We |
/* Try to map additional pages at the end of the region. We |
4453 |
cannot do this if the address range is already occupied by |
cannot do this if the address range is already occupied by |
4454 |
something else because mmap deletes any previous mapping. |
something else because mmap deletes any previous mapping. |
4455 |
I'm not sure this is worth doing, let's see. */ |
I'm not sure this is worth doing, let's see. */ |
4456 |
r2 = mmap_find (region_end, region_end + nbytes); |
if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes)) |
|
if (r2 == NULL) |
|
4457 |
{ |
{ |
4458 |
POINTER_TYPE *p; |
POINTER_TYPE *p; |
4459 |
|
|