porting 'heap_ww.c'