void os_zero(os_vm_address_t addr, os_vm_size_t length) { os_vm_address_t block_start; os_vm_size_t block_size; #ifdef DEBUG fprintf(stderr,";;; os_zero: addr: 0x%08x, len: 0x%08x\n",addr,length); #endif block_start = os_round_up_to_page(addr); length -= block_start-addr; block_size = os_trunc_size_to_page(length); if (block_start > addr) bzero((char *)addr, block_start-addr); if (block_size < length) bzero((char *)block_start+block_size, length-block_size); if (block_size != 0) { /* Now deallocate and allocate the block so that it faults in * zero-filled. */ os_invalidate(block_start, block_size); addr = os_validate(NOT_MOVABLE, block_start, block_size); if (addr == NULL || addr != block_start) lose("os_zero: block moved! 0x%08x ==> 0x%08x\n", block_start, addr); } }
/* win32-os.c covers these, but there is no unixlike-os.c, so the normal * definition goes here. Fixme: (Why) don't these work for Windows? */ void alloc_gc_page() { os_validate(GC_SAFEPOINT_PAGE_ADDR, 4); }
os_vm_address_t os_allocate(os_vm_size_t len) { return os_validate(MOVABLE, (os_vm_address_t)NULL, len); }
/* win32-os.c covers these, but there is no unixlike-os.c, so the normal * definition goes here. Fixme: (Why) don't these work for Windows? */ void alloc_gc_page() { os_validate(NOT_MOVABLE, GC_SAFEPOINT_PAGE_ADDR, 4); }