Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/runtime/gc/obj-info.c
ViewVC logotype

View of /sml/trunk/src/runtime/gc/obj-info.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (download) (as text) (annotate)
Sat Apr 17 18:57:03 1999 UTC (20 years, 5 months ago) by monnier
File size: 820 byte(s)
This commit was generated by cvs2svn to compensate for changes in r249,
which included commits to RCS files with non-trunk default branches.
/* obj-info.c
 *
 * COPYRIGHT (c) 1993 AT&T Bell Laboratories.
 */

#include "ml-base.h"
#include "ml-values.h"
#include "heap.h"
#include "gc.h"

/* GetObjGen:
 *
 * Get the generation of an object (return -1 for external/unboxed objects).
 */
int GetObjGen (ml_val_t obj)
{
    if (isBOXED(obj)) {
	aid_t	aid = ADDR_TO_PAGEID(BIBOP, obj);
	if (IS_BIGOBJ_AID(aid)) {
	    int		i;
	    bigobj_region_t	*region;
	    bigobj_desc_t	*dp;

	    for (i = BIBOP_ADDR_TO_INDEX(obj);  !BO_IS_HDR(aid);  aid = BIBOP[--i])
		continue;
	    region = (bigobj_region_t *)BIBOP_INDEX_TO_ADDR(i);
	    dp = ADDR_TO_BODESC(region, obj);

	    return dp->gen;
	}
	else if (aid == AID_NEW)
	    return 0;
	else if (isUNMAPPED(aid))
	    return -1;
	else
	    return EXTRACT_GEN(aid);
    }
    else
	return -1;

} /* end of GetObjGen */


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0