PR#6084: Define caml_modify and caml_initialize as weak symbols to help

with Netmulticore.  (Reflecting commit r13957 on version/4.01)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13958 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2013-08-01 08:24:07 +00:00
parent 342282d225
commit 931ec15f78
3 changed files with 15 additions and 4 deletions

View File

@ -178,6 +178,8 @@ Bug fixes:
- PR#6056: Using 'match' prevents generalization of values
- PR#6060: ocamlbuild rules for -principal, -strict-sequence and -short-paths
- PR#6090: Module constraint + private type seems brocken in ocaml 4.01.0
- PR#6084: Define caml_modify and caml_initialize as weak symbols to help
with Netmulticore
- PR#6109: Typos in ocamlbuild error messages
Internals:

View File

@ -502,7 +502,8 @@ CAMLexport void caml_adjust_gc_speed (mlsize_t res, mlsize_t max)
*/
/* [caml_initialize] never calls the GC, so you may call it while a block is
unfinished (i.e. just after a call to [caml_alloc_shr].) */
CAMLexport void caml_initialize (value *fp, value val)
/* PR#6084 workaround: define it as a weak symbol */
CAMLexport CAMLweakdef void caml_initialize (value *fp, value val)
{
CAMLassert(Is_in_heap(fp));
*fp = val;
@ -522,10 +523,10 @@ CAMLexport void caml_initialize (value *fp, value val)
in the minor heap instead of in the major heap. In this case, it
is a bit slower than simple assignment.
In particular, you can use [caml_modify] when you don't know whether the
block being changed is in the minor heap or the major heap.
*/
block being changed is in the minor heap or the major heap. */
/* PR#6084 workaround: define it as a weak symbol */
CAMLexport void caml_modify (value *fp, value val)
CAMLexport CAMLweakdef void caml_modify (value *fp, value val)
{
/* The write barrier implemented by [caml_modify] checks for the
following two conditions and takes appropriate action:

View File

@ -51,6 +51,14 @@ typedef char * addr;
#define CAMLprim
#define CAMLextern extern
/* Weak function definitions that can be overriden by external libs */
/* Conservatively restricted to ELF and MacOSX platforms */
#if defined(__GNUC__) && (defined (__ELF__) || defined(__APPLE__))
#define CAMLweakdef __attribute__((weak))
#else
#define CAMLweakdef
#endif
/* Assertions */
/* <private> */