Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-23 04:03:54 +0400
committerChristopher Faylor <me@cgf.cx>2003-08-23 04:03:54 +0400
commit5c6497b43f67ac058e6699ebcd5f3961567ef13c (patch)
tree2b99de220729c9ae9a0d53cc98be0a62812ac423 /winsup/cygwin/mmap.cc
parent7f32ba3a8de4e8c74c7a97d4ee76b1b3a313b6ff (diff)
* cygheap.h (enum cygheap_types): Add HEAP_MMAP.
(CYGHEAPSIZE): Add another 64K. * mmap.cc: Use cmalloc, ccalloc and crealloc with HEAP_MMAP type throughout.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 6af4946a7..f38568f94 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -76,7 +76,7 @@ class mmap_record
caddr_t get_address () const { return base_address_; }
DWORD *get_map () const { return map_map_; }
void alloc_map (_off64_t off, DWORD len);
- void free_map () { if (map_map_) free (map_map_); }
+ void free_map () { if (map_map_) cfree (map_map_); }
DWORD find_empty (DWORD pages);
_off64_t map_map (_off64_t off, DWORD len);
@@ -113,8 +113,8 @@ void
mmap_record::alloc_map (_off64_t off, DWORD len)
{
/* Allocate one bit per page */
- map_map_ = (DWORD *) calloc (MAPSIZE (PAGE_CNT (size_to_map_)),
- sizeof (DWORD));
+ map_map_ = (DWORD *) ccalloc (HEAP_MMAP, MAPSIZE (PAGE_CNT (size_to_map_)),
+ sizeof (DWORD));
if (wincap.virtual_protect_works_on_shared_pages ())
{
DWORD old_prot;
@@ -277,14 +277,14 @@ public:
list::list ()
: nrecs (0), maxrecs (10), fd (0), hash (0)
{
- recs = (mmap_record *) malloc (10 * sizeof (mmap_record));
+ recs = (mmap_record *) cmalloc (HEAP_MMAP, 10 * sizeof (mmap_record));
}
list::~list ()
{
for (mmap_record *rec = recs; nrecs-- > 0; ++rec)
rec->free_map ();
- free (recs);
+ cfree (recs);
}
mmap_record *
@@ -293,7 +293,7 @@ list::add_record (mmap_record r, _off64_t off, DWORD len)
if (nrecs == maxrecs)
{
maxrecs += 5;
- recs = (mmap_record *) realloc (recs, maxrecs * sizeof (mmap_record));
+ recs = (mmap_record *) crealloc (recs, maxrecs * sizeof (mmap_record));
}
recs[nrecs] = r;
recs[nrecs].alloc_map (off, len);
@@ -373,14 +373,14 @@ public:
map::map ()
{
- lists = (list **) malloc (10 * sizeof (list *));
+ lists = (list **) cmalloc (HEAP_MMAP, 10 * sizeof (list *));
nlists = 0;
maxlists = 10;
}
map::~map ()
{
- free (lists);
+ cfree (lists);
}
list *
@@ -408,7 +408,7 @@ map::add_list (list *l, int fd)
if (nlists == maxlists)
{
maxlists += 5;
- lists = (list **) realloc (lists, maxlists * sizeof (list *));
+ lists = (list **) crealloc (lists, maxlists * sizeof (list *));
}
lists[nlists++] = l;
return lists[nlists-1];