/***********************************************************************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_vmregion(){}2425#else2627#include "vmhdr.h"2829/* Return the containing region of an allocated piece of memory.30** Beware: this only works with Vmbest, Vmdebug and Vmprofile.31**32** 10/31/2009: Add handling of shared/persistent memory regions.33**34** Written by Kiem-Phong Vo, [email protected], 01/16/94.35*/36#if __STD_C37Vmalloc_t* vmregion(Void_t* addr)38#else39Vmalloc_t* vmregion(addr)40Void_t* addr;41#endif42{43Vmalloc_t *vm;44Vmdata_t *vd;4546if(!addr)47return NIL(Vmalloc_t*);4849vd = SEG(BLOCK(addr))->vmdt;5051_vmlock(NIL(Vmalloc_t*), 1);52for(vm = Vmheap; vm; vm = vm->next)53if(vm->data == vd)54break;55_vmlock(NIL(Vmalloc_t*), 0);5657return vm;58}5960#endif616263