Mercurial > hg > xemacs-beta
comparison src/mc-alloc.c @ 5042:f395ee7ad844
Fix some compile warnings, make vdb test code conditional on DEBUG_XEMACS
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-15 Ben Wing <ben@xemacs.org>
* mc-alloc.c:
* mc-alloc.c (mc_realloc_1):
* mc-alloc.c (set_dirty_bit):
* mc-alloc.c (set_dirty_bit_for_address):
* mc-alloc.c (get_dirty_bit):
* mc-alloc.c (get_dirty_bit_for_address):
* mc-alloc.c (set_protection_bit):
* mc-alloc.c (set_protection_bit_for_address):
* mc-alloc.c (get_protection_bit):
* mc-alloc.c (get_protection_bit_for_address):
* mc-alloc.c (get_page_start):
* vdb-win32.c (win32_fault_handler):
* vdb.c:
Fix some compile warnings, make vdb test code conditional on
DEBUG_XEMACS.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 15 Feb 2010 21:52:39 -0600 |
parents | 93bd75c45dca |
children | 92dc90c0bb40 |
comparison
equal
deleted
inserted
replaced
5041:efaa6cd845e5 | 5042:f395ee7ad844 |
---|---|
1 /* New size-based allocator for XEmacs. | 1 /* New size-based allocator for XEmacs. |
2 Copyright (C) 2005 Marcus Crestani. | 2 Copyright (C) 2005 Marcus Crestani. |
3 Copyright (C) 2010 Ben Wing. | |
3 | 4 |
4 This file is part of XEmacs. | 5 This file is part of XEmacs. |
5 | 6 |
6 XEmacs is free software; you can redistribute it and/or modify it | 7 XEmacs is free software; you can redistribute it and/or modify it |
7 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
1576 } | 1577 } |
1577 | 1578 |
1578 | 1579 |
1579 /* Changes the size of the cell pointed to by ptr. | 1580 /* Changes the size of the cell pointed to by ptr. |
1580 Returns the new address of the new cell with new size. */ | 1581 Returns the new address of the new cell with new size. */ |
1581 void * | 1582 static void * |
1582 mc_realloc_1 (void *ptr, size_t size, int elemcount) | 1583 mc_realloc_1 (void *ptr, size_t size, int elemcount) |
1583 { | 1584 { |
1584 if (ptr) | 1585 if (ptr) |
1585 { | 1586 { |
1586 if (size * elemcount) | 1587 if (size * elemcount) |
1780 | 1781 |
1781 | 1782 |
1782 /*--- incremental garbage collector ----------------------------------*/ | 1783 /*--- incremental garbage collector ----------------------------------*/ |
1783 | 1784 |
1784 /* access dirty bit of page header */ | 1785 /* access dirty bit of page header */ |
1785 void | 1786 static void |
1786 set_dirty_bit (page_header *ph, unsigned int value) | 1787 set_dirty_bit (page_header *ph, unsigned int value) |
1787 { | 1788 { |
1788 PH_DIRTY_BIT (ph) = value; | 1789 PH_DIRTY_BIT (ph) = value; |
1789 } | 1790 } |
1790 | 1791 |
1791 void | 1792 static void |
1792 set_dirty_bit_for_address (void *ptr, unsigned int value) | 1793 set_dirty_bit_for_address (void *ptr, unsigned int value) |
1793 { | 1794 { |
1794 set_dirty_bit (get_page_header (ptr), value); | 1795 set_dirty_bit (get_page_header (ptr), value); |
1795 } | 1796 } |
1796 | 1797 |
1797 unsigned int | 1798 static unsigned int |
1798 get_dirty_bit (page_header *ph) | 1799 get_dirty_bit (page_header *ph) |
1799 { | 1800 { |
1800 return PH_DIRTY_BIT (ph); | 1801 return PH_DIRTY_BIT (ph); |
1801 } | 1802 } |
1802 | 1803 |
1803 unsigned int | 1804 static unsigned int |
1804 get_dirty_bit_for_address (void *ptr) | 1805 get_dirty_bit_for_address (void *ptr) |
1805 { | 1806 { |
1806 return get_dirty_bit (get_page_header (ptr)); | 1807 return get_dirty_bit (get_page_header (ptr)); |
1807 } | 1808 } |
1808 | 1809 |
1809 | 1810 |
1810 /* access protection bit of page header */ | 1811 /* access protection bit of page header */ |
1811 void | 1812 static void |
1812 set_protection_bit (page_header *ph, unsigned int value) | 1813 set_protection_bit (page_header *ph, unsigned int value) |
1813 { | 1814 { |
1814 PH_PROTECTION_BIT (ph) = value; | 1815 PH_PROTECTION_BIT (ph) = value; |
1815 } | 1816 } |
1816 | 1817 |
1817 void | 1818 static void |
1818 set_protection_bit_for_address (void *ptr, unsigned int value) | 1819 set_protection_bit_for_address (void *ptr, unsigned int value) |
1819 { | 1820 { |
1820 set_protection_bit (get_page_header (ptr), value); | 1821 set_protection_bit (get_page_header (ptr), value); |
1821 } | 1822 } |
1822 | 1823 |
1823 unsigned int | 1824 static unsigned int |
1824 get_protection_bit (page_header *ph) | 1825 get_protection_bit (page_header *ph) |
1825 { | 1826 { |
1826 return PH_PROTECTION_BIT (ph); | 1827 return PH_PROTECTION_BIT (ph); |
1827 } | 1828 } |
1828 | 1829 |
1829 unsigned int | 1830 static unsigned int |
1830 get_protection_bit_for_address (void *ptr) | 1831 get_protection_bit_for_address (void *ptr) |
1831 { | 1832 { |
1832 return get_protection_bit (get_page_header (ptr)); | 1833 return get_protection_bit (get_page_header (ptr)); |
1833 } | 1834 } |
1834 | 1835 |
1835 | 1836 |
1836 /* Returns the start of the page of the object pointed to by ptr. */ | 1837 /* Returns the start of the page of the object pointed to by ptr. */ |
1837 void * | 1838 static void * |
1838 get_page_start (void *ptr) | 1839 get_page_start (void *ptr) |
1839 { | 1840 { |
1840 return PH_HEAP_SPACE (get_page_header (ptr)); | 1841 return PH_HEAP_SPACE (get_page_header (ptr)); |
1841 } | 1842 } |
1842 | 1843 |