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

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/gc/big-objects.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/gc/big-objects.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3, Sat Oct 4 23:33:46 1997 UTC revision 8, Sun Jan 18 01:01:29 1998 UTC
# Line 250  Line 250 
250      return ADDR_TO_BODESC(rp, addr);      return ADDR_TO_BODESC(rp, addr);
251    
252  } /* end of BO_GetDesc */  } /* end of BO_GetDesc */
253    
254    
255    /* BO_AddrToCodeObjTag:
256     *
257     * Return the tag of the code object containing the given PC (or else
258     * NIL).
259     */
260    char *BO_AddrToCodeObjTag (Word_t pc, char *buf, int bufSz)
261    {
262        bigobj_region_t     *region;
263        bigobj_desc_t       *bdp;
264        aid_t               aid;
265    
266        aid = ADDR_TO_PAGEID(BIBOP, pc);
267    
268        if (IS_BIGOBJ_AID(aid)) {
269            int             indx = BIBOP_ADDR_TO_INDEX(pc);
270            while (!BO_IS_HDR(aid))
271                aid = BIBOP[--indx];
272            region = (bigobj_region_t *)BIBOP_INDEX_TO_ADDR(indx);
273            return BO_GetCodeObjTag (ADDR_TO_BODESC(region, pc), buf, bufSz);
274        }
275        else
276            return NIL(char *);
277    
278    } /* end of BO_AddrToCodeObjTag */
279    
280    
281    /* BO_GetCodeObjTag:
282     *
283     * Return the tag of the given code object (return NIL, if it doesn't
284     * fit in the buffer).
285     */
286    char *BO_GetCodeObjTag (bigobj_desc_t *bdp, char *buf, int bufSz)
287    {
288        Byte_t              *lastByte;
289        int                 len;
290    
291        lastByte = (Byte_t *)(bdp->obj) + bdp->sizeB - 1;
292        len = *lastByte;
293        if (len < bufSz) {
294            strncpy (buf, lastByte-len, len);
295            buf[len] = '\0';
296            return buf;
297        }
298        else
299            return NIL(char *);
300    
301    } /* end of BO_GetCodeObjTag */
302    

Legend:
Removed from v.3  
changed lines
  Added in v.8

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