Commit Graph

497 Commits (a09a2a20f8a54751ab825834e860ea3170245bc1)

Author SHA1 Message Date
Stephen Dolan 01c08d3c0c Clean up caml_alloc_shr 2020-11-17 11:59:05 +00:00
David Allsopp 692bd73123 OCAMLRUNPARAM=b=2 => load debuginfo
Load the debug information during runtime startup if OCAMLRUNPARAM=b=2.
This guards against the specific case of running out of fds, since the
debug information can't then be loaded.
2018-12-11 10:17:04 +01:00
David Allsopp 43b28fac00 Improve error messages when loading backtrace info
Before, any errors when loading bytecode backtrace information were
fatal and the error message was potentially misleading.
2018-12-11 08:54:49 +01:00
Jacques-Henri Jourdan 0f64cc87b0 Fix a bug in PR9742: in naked pointers mode, the code could
dereference a pointer before checking it is not a naked pointer.

Algo fix a debug macro changed in PR9742 which could potentially
modify its parameter. It turns out this is not a bug, but the macro
was still particularly dangerous.
2020-10-26 10:21:59 +01:00
Leo White 055f04d189
Merge pull request #9631 from gretay-js/named_sections_for_caml_system_code
Named text sections for caml_system__code_begin/end symbols
2020-10-22 10:12:02 +01:00
Greta Yorsh 30e1e534d7 Add named text sections for caml_system__code_begin/end symbols 2020-10-19 16:47:13 +01:00
Jacques-Henri Jourdan 6d3065be78 Memprof: get rid of the idx_ptr pointers.
Instead, we use a thread-local variable [callback_status] which
contains the index of the corresponding entry when a callback is
running. We can do this since there can only be one running callback
at the same time in a given thread.

This lifts the restriction forbidding the call of Thread.exit from a
memprof callback.
2020-10-19 17:11:11 +02:00
Jacques-Henri Jourdan f83d71830d Memprof: provide the guarantee that an allocation callback is always run in the same thread the allocation takes place.
This is done by using a local entry array for each thread, containing
tracked blocks whose allocation callback has not yet been called.

This allows some simplification in the code running callbacks for
young allocations. Indeed, since the entry array is local to one
thread, we know for sure that it cannot be modified during a callback,
and therefore we no longer need to remember the indices of the
corresponding new entries.
2020-10-19 17:08:17 +02:00
Jacques-Henri Jourdan 18c0f95560 Memprof : Refactor [run_callback_exn] so that it also stores the value returned by the callback. 2020-10-19 17:00:04 +02:00
Jacques-Henri Jourdan ea52bec84b Memprof: thread-local context is now stored as a pointer in systhread's data structures.
Reasons:
- Better abstraction in memprof.h
- Simpler Saving/restore functions
- We introduce a current's thread context, so that we don't need to do a spacial case for the current thread
2020-10-19 17:00:04 +02:00
Jacques-Henri Jourdan 13a874cf3f Memprof : get rid of the tracking_state struct, and create an entry_array struct, which only contains information specific to the array. 2020-10-19 16:41:13 +02:00
Jacques-Henri Jourdan 11411635bc Memprof: refactor realloc_trackst. 2020-10-19 16:41:13 +02:00
Jacques-Henri Jourdan d1800821df Gc.Memprof.stop does no longer try to run pending callbacks.
This is only effetive in native mode, since function calls in bytecode
mode will trigger polling and hence run pending callbacks.
2020-10-19 16:41:13 +02:00
Jacques-Henri Jourdan b371c21396 Memprof: fix rounding error. 2020-10-19 16:41:13 +02:00
Jacques-Henri Jourdan cad494b399 Whitespace, typos. 2020-10-19 16:36:23 +02:00
Florian Angeletti 55973d1203 Bump magic numbers for 4.12 (and trunk) 2020-10-19 15:33:26 +02:00
jacobly0 8a46d76bf9
Fix mergeable section flags and use .rodata.cst16 where appropriate (#9981)
On x86-64 ELF, the `.rodata.cst8` section was incorrectly used.
2020-10-18 13:57:53 +02:00
Xavier Leroy 86c8a98f3c
Merge pull request #9948 from nojb/remove_spacetime
The Spacetime memory profiler is not going to be supported in Multicore OCaml, and  is already broken by some of the related changes in OCaml 4.12.  The core development team decided to remove Spacetime support from OCaml 4.12.
2020-10-09 14:43:23 +02:00
Damien Doligez 0069123c61
clean up and fix GC message 0x1 (#9949) 2020-10-09 12:02:00 +02:00
Nicolás Ojeda Bär 67c9c0772e Remove Spacetime support in marshaller 2020-10-08 20:28:15 +02:00
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Xavier Leroy af48d9fe8f
Add a naked pointers dynamic checker (#9956)
This is selected at configure-time, option --enable-naked-pointers-checker.

The major GC warns when it detects out-of-heap pointers that could cause the no-naked-pointers runtime system to crash.

This is supported on x86-64 only, but on all ports (Unix and Windows).

Added tests involving naked pointers in tests/runtime-naked-pointers

Co-authored-by: KC Sivaramakrishnan <kc@kcsrk.info>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: Enguerrand Decorne <decorne.en@gmail.com>
2020-10-05 14:44:31 +02:00
KC Sivaramakrishnan 530330f3cf
Ensure that the mark stack push optimisation handles naked pointers. (#9951)
Fixes: #9950.
2020-10-02 15:13:16 +02:00
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
David Allsopp fed86fb598
Merge pull request #9924 from dra27/explicit-export-PR
Remaining functions requiring explicit export
2020-09-21 08:59:06 +01:00
David Allsopp 17cceab054 Remaining functions requiring explicit export 2020-09-18 12:11:20 +01:00
Sadiq Jaffer c10217818f
Garbage collector colours change (#9756) 2020-09-17 17:24:04 +02:00
David Allsopp a65ab1874c
Merge pull request #9912 from dra27/remove-spacetime-link-kludge
Remove caml_ensure_spacetime_dot_o_is_included
2020-09-15 10:43:10 +01:00
David Allsopp e963093f00 Remove unnecssary spacetime disabled stubs 2020-09-14 18:03:00 +01:00
David Allsopp f5eb31b774 Include parameters on dummy spacetime stubs 2020-09-14 18:02:46 +01:00
David Allsopp 23f60e3c2f Minor comment fix 2020-09-14 18:02:20 +01:00
David Allsopp fb84009c58 Use CAMLexport not CAMLprim for C functions 2020-09-14 18:01:27 +01:00
David Allsopp 0bd6c0d36f Remove unused spacetime primitives 2020-09-14 18:01:14 +01:00
David Allsopp 13bba6531b Remove leaking globals 2020-09-14 16:40:12 +01:00
David Allsopp 954128bc5c Make caml_spacetime_automatic_save static
There's no need for this function to be globally visible.
2020-09-14 14:56:57 +01:00
David Allsopp 0c646d4f4e Remove unnecessary extern's in spacetime_nat.c
These are declared in respective headers already.
2020-09-14 14:56:07 +01:00
David Allsopp b38f4962e9 Remove undefined declaration of caml_spacetime_debug 2020-09-14 14:55:17 +01:00
David Allsopp 46da6eb4bc Tidy spacetime.h 2020-09-14 14:54:10 +01:00
David Allsopp 89ef6199bd Remove caml_ensure_spacetime_dot_o_is_included 2020-09-14 11:42:59 +01:00
David Allsopp 3b1d4dafe0
Eliminate caml_code_area globals (#9909) 2020-09-14 09:16:09 +01:00
David Allsopp 28789cd045
Merge pull request #9904 from dra27/unix-io-prims
Declare primitives used by unix in io.h
2020-09-11 09:35:31 +01:00
David Allsopp 95ea8a2d32
Merge pull request #9902 from dra27/main-cleanup
Declare caml_expand_command_line in osdeps.h
2020-09-11 09:34:47 +01:00
David Allsopp d889d8f565
Merge pull request #9901 from dra27/caml_main
Tidy caml_main declaration
2020-09-11 09:34:29 +01:00
David Allsopp 435babd6f8 Declare primitives used by unix in io.h 2020-09-10 16:34:24 +01:00
David Allsopp 503776deb4 Declare caml_expand_command_line in osdeps.h 2020-09-10 12:11:02 +01:00
David Allsopp 29408deb2c Tidy caml_main declaration 2020-09-10 12:05:46 +01:00
David Allsopp 121cae4801 Remove CAMLprim and CAMLexport from backtrace.h 2020-09-10 11:01:19 +01:00
David Allsopp df64b46a7c Remove dup. declaration of caml_sys_time_unboxed 2020-09-10 09:54:43 +01:00
David Allsopp 6dc2457036
Merge pull request #9884 from dra27/cygwin64-prereq-6
Missing declarations in io.h [Cygwin64 pre-req 6/6]
2020-09-09 09:24:34 +01:00
David Allsopp f62d519be7
Merge pull request #9882 from dra27/cygwin64-prereq-4
Tidy CAML_INTERNALS in minor_gc.h and memory.h [Cygwin64 pre-req 4/6]
2020-09-09 09:23:50 +01:00