Skip to content

Commit 0581a07

Browse files
author
Damien Doligez
committed
fix commit 16156 for 32-bit Windows/MSVC
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@16159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1 parent 5000f26 commit 0581a07

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

asmrun/signals_asm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <signal.h>
2020
#include <errno.h>
2121
#include <stdio.h>
22-
#include "caml/address_class.h"
2322
#include "caml/fail.h"
2423
#include "caml/memory.h"
2524
#include "caml/osdeps.h"
@@ -45,6 +44,18 @@ extern signal_handler caml_win32_signal(int sig, signal_handler action);
4544
extern void caml_win32_overflow_detection();
4645
#endif
4746

47+
extern char * caml_code_area_start, * caml_code_area_end;
48+
extern char caml_system__code_begin, caml_system__code_end;
49+
50+
/* Do not use the macro from address_class.h here. */
51+
#undef Is_in_code_area
52+
#define Is_in_code_area(pc) \
53+
( ((char *)(pc) >= caml_code_area_start && \
54+
(char *)(pc) <= caml_code_area_end) \
55+
|| ((char *)(pc) >= &caml_system__code_begin && \
56+
(char *)(pc) <= &caml_system__code_end) \
57+
|| (Classify_addr(pc) & In_code_area) )
58+
4859
/* This routine is the common entry point for garbage collection
4960
and signal handling. It can trigger a callback to OCaml code.
5061
With system threads, this callback can cause a context switch.

byterun/caml/address_class.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,17 @@
3333
#define Is_in_value_area(a) \
3434
(Classify_addr(a) & (In_heap | In_young | In_static_data))
3535

36-
#ifdef NATIVE_CODE
3736
#define Is_in_code_area(pc) \
3837
( ((char *)(pc) >= caml_code_area_start && \
3938
(char *)(pc) <= caml_code_area_end) \
40-
|| ((char *)(pc) >= &caml_system__code_begin && \
41-
(char *)(pc) <= &caml_system__code_end) \
4239
|| (Classify_addr(pc) & In_code_area) )
43-
#else
44-
#define Is_in_code_area(pc) \
45-
( ((char *)(pc) >= caml_code_area_start && \
46-
(char *)(pc) <= caml_code_area_end) \
47-
|| (Classify_addr(pc) & In_code_area) )
48-
#endif /* NATIVE_CODE */
4940

5041

5142
/***********************************************************************/
5243
/* The rest of this file is private and may change without notice. */
5344

5445
extern char *caml_young_start, *caml_young_end;
5546
extern char * caml_code_area_start, * caml_code_area_end;
56-
#ifdef NATIVE_CODE
57-
extern char caml_system__code_begin, caml_system__code_end;
58-
#endif
5947

6048
#define Not_in_heap 0
6149
#define In_heap 1

0 commit comments

Comments
 (0)