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 224 - (download) (as text) (annotate)
Sat Apr 17 16:27:01 1999 UTC (21 years, 2 months ago) by monnier
File size: 820 byte(s)
This commit was generated by cvs2svn to compensate for changes in r223,
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])
	    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;
	    return EXTRACT_GEN(aid);
	return -1;

} /* end of GetObjGen */

ViewVC Help
Powered by ViewVC 1.0.0