summaryrefslogtreecommitdiff
path: root/obj_map.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-10-21 11:33:39 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:51 +0200
commitbad4c7acb6060861cd4be55968c1f58b2026a747 (patch)
treee4772ccd33aeec9ccd4d9baadbadb48a913a13e2 /obj_map.c
parentc4e4721f491632c2039cece14400f353794273f4 (diff)
2009-10-21 Ivan Maidanski <ivmai@mail.ru>
* allchblk.c (DEBUG): Remove macro (since unused). * allchblk.c: Include private/gc_priv.h before other includes and definitions. * alloc.c: Ditto. * gc_dlopen.c: Ditto. * headers.c: Ditto. * mallocx.c: Ditto. * mark_rts.c: Ditto. * new_hblk.c: Ditto. * reclaim.c: Ditto. * mark.c: Include private/gc_pmark.h before other includes. * misc.c: Ditto. * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h. * pthread_support.c (_USING_POSIX4A_DRAFT10): Ditto. * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since already defined in gc_config_macros.h). * dyn_load.c (GC_init_dyld): Remove parameter cast for _dyld_register_func_for_add_image() and _dyld_register_func_for_remove_image(); add the comment about possible warnings; add FIXME for the deprecated _dyld_bind_fully_image_containing_address(). * include/private/gc_priv.h: Include gc.h before the standard headers inclusion. * tests/test.c: Ditto. * include/private/gcconfig.h (DebugBreak): Update the comment. * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'. * alloc.c: Reformat the code (partly adjust indentation). * backgraph.c: Ditto. * blacklst.c: Ditto. * checksums.c: Ditto. * finalize.c: Ditto. * gcj_mlc.c: Ditto. * mach_dep.c: Ditto. * mark_rts.c: Ditto. * obj_map.c: Ditto. * os_dep.c: Ditto. * ptr_chck.c: Ditto. * stubborn.c: Ditto. * thread_local_alloc.c: Ditto. * typd_mlc.c: Ditto.
Diffstat (limited to 'obj_map.c')
-rw-r--r--obj_map.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/obj_map.c b/obj_map.c
index 96a2174..542cc71 100644
--- a/obj_map.c
+++ b/obj_map.c
@@ -13,14 +13,14 @@
* modified is included with the above copyright notice.
*/
+#include "private/gc_priv.h"
+
/* Routines for maintaining maps describing heap block
* layouts for various object sizes. Allows fast pointer validity checks
* and fast location of object start locations on machines (such as SPARC)
* with slow division.
*/
-# include "private/gc_priv.h"
-
/* Consider pointers that are offset bytes displaced from the beginning */
/* of an object to be valid. */
@@ -45,11 +45,11 @@ void GC_register_displacement_inner(size_t offset)
}
#ifdef MARK_BIT_PER_GRANULE
-/* Add a heap block map for objects of size granules to obj_map. */
-/* Return FALSE on failure. */
-/* A size of 0 granules is used for large objects. */
-GC_bool GC_add_map_entry(size_t granules)
-{
+ /* Add a heap block map for objects of size granules to obj_map. */
+ /* Return FALSE on failure. */
+ /* A size of 0 granules is used for large objects. */
+ GC_bool GC_add_map_entry(size_t granules)
+ {
unsigned displ;
short * new_map;
@@ -73,17 +73,18 @@ GC_bool GC_add_map_entry(size_t granules)
}
GC_obj_map[granules] = new_map;
return(TRUE);
-}
+ }
#endif
-static GC_bool offsets_initialized = FALSE;
-
void GC_initialize_offsets(void)
{
+ static GC_bool offsets_initialized = FALSE;
+
if (!offsets_initialized) {
int i;
if (GC_all_interior_pointers) {
- for (i = 0; i < VALID_OFFSET_SZ; ++i) GC_valid_offsets[i] = TRUE;
+ for (i = 0; i < VALID_OFFSET_SZ; ++i)
+ GC_valid_offsets[i] = TRUE;
}
offsets_initialized = TRUE;
}