/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#if defined(_UWIN) && defined(_BLD_ast)2223void _STUB_vmwalk(){}2425#else2627#include "vmhdr.h"2829/* Walks all segments created in region(s)30**31** Written by Kiem-Phong Vo, [email protected] (02/08/96)32*/3334#if __STD_C35int vmwalk(Vmalloc_t* vm, int(*segf)(Vmalloc_t*, Void_t*, size_t, Vmdisc_t*, Void_t*), Void_t* handle )36#else37int vmwalk(vm, segf, handle)38Vmalloc_t* vm;39int(* segf)(/* Vmalloc_t*, Void_t*, size_t, Vmdisc_t*, Void_t* */);40Void_t* handle;41#endif42{43reg Seg_t *seg;44reg int rv = 0;4546if(!vm)47{ _vmlock(NIL(Vmalloc_t*), 1);48for(vm = Vmheap; vm; vm = vm->next)49{ SETLOCK(vm, 0);50for(seg = vm->data->seg; seg; seg = seg->next)51if((rv = (*segf)(vm, seg->addr, seg->extent, vm->disc, handle)) < 0 )52break;53CLRLOCK(vm, 0);54}55_vmlock(NIL(Vmalloc_t*), 0);56}57else58{ SETLOCK(vm, 0);59for(seg = vm->data->seg; seg; seg = seg->next)60if((rv = (*segf)(vm, seg->addr, seg->extent, vm->disc, handle)) < 0 )61break;62CLRLOCK(vm, 0);63}6465return rv;66}6768#endif697071