Commit Graph

505 Commits (master)

Author SHA1 Message Date
Florian Angeletti 3d6dc0fa64
Merge pull request #9955 from damiendoligez/fix-7813
Fix #7813 (major GC fails to start)
2020-11-24 16:20:53 +01:00
Jacques-Henri Jourdan 328ebc1ea3
Merge pull request #10025 from stedolan/memprof-custom
Track caml_alloc_custom_mem allocations with Statmemprof
2020-11-24 10:06:52 +01:00
Stephen Dolan 8caa14c3bd check-typo 2020-11-18 09:22:26 +00:00
Stephen Dolan 01c08d3c0c Clean up caml_alloc_shr 2020-11-17 11:59:05 +00:00
Stephen Dolan 7cd0b3981b Memprof: refactor by introducing maybe_track_block 2020-11-17 11:30:38 +00:00
Stephen Dolan 6a3af5c926 Add Gc.Memprof.allocation_source 2020-11-17 11:17:52 +00:00
Stephen Dolan 3631d4b543 Track caml_alloc_custom_mem allocations with Statmemprof 2020-11-16 13:42:16 +00:00
Damien Doligez dff48afa72 If the major GC is in Phase_idle, caml_gc_major_slice must start a new
major GC cycle instead of just calling caml_major_collection_slice.
fixes #7813
2020-11-03 11:09:35 +01:00
Damien Doligez 2339a8c907 Change workflow of caml_gc_dispatch to make sure the major GC does not
stall when no minor allocations take place.
2020-11-03 10:49:33 +01: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