Skip to content

Commit

Permalink
Making Coq compile with ocp-memprof.
Browse files Browse the repository at this point in the history
Patch provided by Çagdas Bozman.
  • Loading branch information
ppedrot committed Jun 1, 2015
1 parent 43aa642 commit 3b917b7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion kernel/byterun/coq_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define _COQ_CAML_GC_
#include <caml/mlvalues.h>
#include <caml/alloc.h>
#include <caml/memory.h>

typedef void (*scanning_action) (value, value *);

Expand All @@ -24,12 +25,22 @@ CAMLextern void minor_collection (void);
#define Caml_white (0 << 8)
#define Caml_black (3 << 8)

#ifdef HAS_OCP_MEMPROF

/* This code is necessary to make the OCamlPro memory profiling branch of
OCaml compile. */

#define Make_header(wosize, tag, color) \
caml_make_header(wosize, tag, color)

#else

#define Make_header(wosize, tag, color) \
(((header_t) (((header_t) (wosize) << 10) \
+ (color) \
+ (tag_t) (tag))) \
)

#endif

#define Alloc_small(result, wosize, tag) do{ \
young_ptr -= Bhsize_wosize (wosize); \
Expand Down

0 comments on commit 3b917b7

Please sign in to comment.