+2007-01-02 Hans Boehm <Hans.Boehm@hp.com>
+
+ * alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
+ adjusting p.
+
2007-12-23 Hans Boehm <Hans.Boehm@hp.com>
* Makefile.am: Add NT_X64_THREADS_MAKEFILE.
if (GC_n_heap_sects >= MAX_HEAP_SECTS) {
ABORT("Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS");
}
- phdr = GC_install_header(p);
- if (0 == phdr) {
- /* This is extremely unlikely. Can't add it. This will */
- /* almost certainly result in a 0 return from the allocator, */
- /* which is entirely appropriate. */
- return;
- }
while ((word)p <= HBLKSIZE) {
/* Can't handle memory near address zero. */
++p;
if (0 == bytes) return;
endp -= HBLKSIZE;
}
+ phdr = GC_install_header(p);
+ if (0 == phdr) {
+ /* This is extremely unlikely. Can't add it. This will */
+ /* almost certainly result in a 0 return from the allocator, */
+ /* which is entirely appropriate. */
+ return;
+ }
GC_ASSERT(endp > (word)p && endp == (word)p + bytes);
GC_heap_sects[GC_n_heap_sects].hs_start = (ptr_t)p;
GC_heap_sects[GC_n_heap_sects].hs_bytes = bytes;