Blame stubborn.c

Packit d28291
/*
Packit d28291
 * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
Packit d28291
 * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
Packit d28291
 *
Packit d28291
 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
Packit d28291
 * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
Packit d28291
 *
Packit d28291
 * Permission is hereby granted to use or copy this program
Packit d28291
 * for any purpose,  provided the above notices are retained on all copies.
Packit d28291
 * Permission to modify the code and to distribute modified code is granted,
Packit d28291
 * provided the above notices are retained, and a notice that the code was
Packit d28291
 * modified is included with the above copyright notice.
Packit d28291
 */
Packit d28291
Packit d28291
#include "private/gc_priv.h"
Packit d28291
Packit d28291
#if defined(MANUAL_VDB)
Packit d28291
Packit d28291
  /* Stubborn object (hard to change, nearly immutable) allocation.     */
Packit d28291
  /* This interface is deprecated.  We mostly emulate it using          */
Packit d28291
  /* MANUAL_VDB.  But that imposes the additional constraint that       */
Packit d28291
  /* written, but not yet GC_dirty()ed objects must be referenced       */
Packit d28291
  /* by a stack.                                                        */
Packit d28291
Packit d28291
  void GC_dirty(ptr_t p);
Packit d28291
Packit d28291
  GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_stubborn(size_t lb)
Packit d28291
  {
Packit d28291
    return(GC_malloc(lb));
Packit d28291
  }
Packit d28291
Packit d28291
  GC_API void GC_CALL GC_end_stubborn_change(const void *p)
Packit d28291
  {
Packit d28291
    GC_dirty((ptr_t)p);
Packit d28291
  }
Packit d28291
Packit d28291
  GC_API void GC_CALL GC_change_stubborn(const void *p GC_ATTR_UNUSED)
Packit d28291
  {
Packit d28291
  }
Packit d28291
Packit d28291
#else /* !MANUAL_VDB */
Packit d28291
Packit d28291
  GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_stubborn(size_t lb)
Packit d28291
  {
Packit d28291
    return(GC_malloc(lb));
Packit d28291
  }
Packit d28291
Packit d28291
  GC_API void GC_CALL GC_end_stubborn_change(const void *p GC_ATTR_UNUSED)
Packit d28291
  {
Packit d28291
  }
Packit d28291
Packit d28291
  GC_API void GC_CALL GC_change_stubborn(const void *p GC_ATTR_UNUSED)
Packit d28291
  {
Packit d28291
  }
Packit d28291
Packit d28291
#endif /* !MANUAL_VDB */