Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: fix typos and grammar #51547

Merged
merged 7 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/src/devdocs/valgrind.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Using Valgrind with Julia

[Valgrind](https://valgrind.org/) is a tool for memory debugging, memory leak detection, and profiling.
[Valgrind](https://valgrind.org/) is a tool for memory-debugging, memory leak detection, and profiling.
This section describes things to keep in mind when using Valgrind to debug memory issues with
Julia.

## General considerations

By default, Valgrind assumes that there is no self modifying code in the programs it runs. This
By default, Valgrind assumes that, there is no self modifying code in the programs it runs. This
assumption works fine in most instances but fails miserably for a just-in-time compiler like
`julia`. For this reason it is crucial to pass `--smc-check=all-non-file` to `valgrind`, else
code may crash or behave unexpectedly (often in subtle ways).

In some cases, to better detect memory errors using Valgrind it can help to compile `julia` with
memory pools disabled. The compile-time flag `MEMDEBUG` disables memory pools in Julia, and
In some cases, to better detect memory errors using Valgrind, it can help to compile `julia` with
memory pools disabled. The compile-time flag `MEMDEBUG` disables memory pools in Julia and
`MEMDEBUG2` disables memory pools in FemtoLisp. To build `julia` with both flags, add the following
line to `Make.user`:

```make
CFLAGS = -DMEMDEBUG -DMEMDEBUG2
```

Another thing to note: if your program uses multiple workers processes, it is likely that you
Another thing to note: if your program uses multiple worker processes, it is likely that you
want all such worker processes to run under Valgrind, not just the parent process. To do this,
pass `--trace-children=yes` to `valgrind`.

Expand Down Expand Up @@ -57,7 +57,7 @@ to `valgrind` as well.

## Additional spurious warnings

This section covers Valgrind warnings which cannot be added to the
This section covers Valgrind warnings that cannot be added to the
suppressions file yet are nonetheless safe to ignore.

### Unhandled rr system calls
Expand All @@ -73,18 +73,18 @@ when julia tries to detect whether it is running under rr:
--xxxxxx-- WARNING: unhandled amd64-linux syscall: 1008
--xxxxxx-- You may be able to write your own handler.
--xxxxxx-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--xxxxxx-- Nevertheless we consider this a bug. Please report
--xxxxxx-- Nevertheless, we consider this a bug. Please report
--xxxxxx-- it at http://valgrind.org/support/bug_reports.html.
```

This issue
[has been reported](https://bugs.kde.org/show_bug.cgi?id=446401)
to the Valgrind developers as they have requested.
to the Valgrind developers they have requested.

## Caveats

Valgrind currently [does not support multiple rounding modes](https://bugs.kde.org/show_bug.cgi?id=136779),
so code that adjusts the rounding mode will behave differently when run under Valgrind.
so code that adjusts the rounding mode will behave differently, when run under Valgrind.

In general, if after setting `--smc-check=all-non-file` you find that your program behaves differently
when run under Valgrind, it may help to pass `--tool=none` to `valgrind` as you investigate further.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ julia> ["a", "list", "of", "strings"] .|> [uppercase, reverse, titlecase, length
7
```

When combining pipes with anonymous functions, parentheses must be used if subsequent pipes are not to be parsed as part of the anonymous function's body. Compare:
When combining pipes with anonymous functions, it is mandatory to use parentheses if the subsequent pipes are not to parse as part of the private function's body. Compare:

```jldoctest
julia> 1:3 .|> (x -> x^2) |> sum |> sqrt
Expand Down