Skip to content

Commit ebda51a

Browse files
kianmenghappi
authored andcommitted
Fix typos again
Found via `codespell -L rouge,intial,reseting,stap,fith`
1 parent d925c6e commit ebda51a

12 files changed

Lines changed: 25 additions & 25 deletions

File tree

chapters/beam_loader.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ OpCase(move_return_x):
175175
}
176176
-----------------------------
177177

178-
All the implementor has to do is to define the `MoveReturn` macro in `beam_emu.c` and
178+
All the implementer has to do is to define the `MoveReturn` macro in `beam_emu.c` and
179179
the instruction is complete.
180180

181181
[[macro_arguments]]

chapters/c.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ either beam instructions or BIFs, depending on their complexity.
397397
Library functions are basic Erlang functions such as 'lists:length/1' that are part of the Erlang language. They could be implemented as BEAM instructions,
398398
BIFS, or in Erlang.
399399

400-
BIFs are efficient as they are writen in C and optimized for performance within the BEAM.
400+
BIFs are efficient as they are written in C and optimized for performance within the BEAM.
401401
The disadvantages with BIFs are that long-running BIFs can block BEAM schedulers, affecting system responsiveness. They have limited extensibility as they are fixed within the runtime system.
402402

403403
Most Erlang users will never need to write a BIF, but it is good to know what they are and how they work. Also if you are writing an EEP (Erlang Enhancement Proposal) you might need to write a BIF to implement the new functionality.
@@ -449,7 +449,7 @@ BIF_RETTYPE math_factorial_1(BIF_ALIST_1)
449449
long factorial = 1;
450450
Eterm result;
451451

452-
/* Check the arguemnt and return an error if it is not a positive integer.
452+
/* Check the argument and return an error if it is not a positive integer.
453453
When defining a BIF with BIF_ALIST_X the arguments are named
454454
BIF_ARG_1, BIF_ARG_2 etc.
455455
To signal ann error use BIF_ERROR(BIF_P, BADARG);
@@ -629,7 +629,7 @@ tuple and call 'math_factorial_trap_1'.
629629
Now when we come back from a yield we might already have a bignum so we
630630
restructure the code a bit to handle this case.
631631

632-
We check our iterator and every 1000 interations we save the state and yield. We also save the state and yield when we have a bignum.
632+
We check our iterator and every 1000 iterations we save the state and yield. We also save the state and yield when we have a bignum.
633633

634634
```c
635635
static Export math_factorial_trap_export;
@@ -719,7 +719,7 @@ bignum_loop:
719719
// Increment i so we don't get stuck in a loop. with i % 1000 == 0.
720720
// Save state: {(i+1), i!, n} and yield.
721721

722-
// Store the tuple with the sate on the heap
722+
// Store the tuple with the state on the heap
723723
big_size = BIG_SIZE(big_val(big_factorial));
724724
hp = HAlloc(BIF_P, 4 + big_size + 1);
725725
big_hp = hp + 4;
@@ -790,7 +790,7 @@ It was a calm night, one of those rare occasions where everything in the system
790790

791791
In the aftermath, the investigation revealed a peculiar sequence of events. The BEAM schedulers, designed to gracefully balance work and sleep, had been too eager to shut down when the workload diminished. Only a single scheduler remained active, handling the entirety of the system's operations.
792792

793-
As fate would have it, this lone scheduler stumbled upon a task: converting a 4MB term into a binary for logging purposes. This seemingly routine operation invoked the term_to_binary function—a built-in function (BIF). Instead of breaking its workload into manageable chunks, it perfomed all the work until done and then reported it had used only 20 reductions.
793+
As fate would have it, this lone scheduler stumbled upon a task: converting a 4MB term into a binary for logging purposes. This seemingly routine operation invoked the term_to_binary function—a built-in function (BIF). Instead of breaking its workload into manageable chunks, it performed all the work until done and then reported it had used only 20 reductions.
794794

795795
This non-yielding nature proved to be a fatal flaw. The single scheduler became entirely consumed, unable to handle other tasks or respond to the system's needs. Erlang's HEART mechanism, ever vigilant, detected the unresponsiveness and concluded that the node was beyond saving. With grim efficiency, it killed the node.
796796

chapters/compiler.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ parse_json({cons, Line, Head, Tail}) -> {cons, Line, parse_json(Head),
894894
parse_json({nil, Line}) -> {nil, Line};
895895
%% Json String -> <<String>>
896896
parse_json({string, Line, String}) -> str_to_bin(String, Line);
897-
%% Json Integer -> Intger
897+
%% Json Integer -> Integer
898898
parse_json({integer, Line, Integer}) -> {integer, Line, Integer};
899899
%% Json Float -> Float
900900
parse_json({float, Line, Float}) -> {float, Line, Float};

chapters/debugging.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
=== Introduction
55
This chapter goes into the various methods for finding and fixing bugs without disrupting the services in progress. We will explore testing techniques, tools, and frameworks that aid in testing and debugging your code. We'll also shed light on some common bug sources, such as deadlocks, message overflow, and memory issues, providing guidance on identifying and resolving these problems.
66

7-
Debugging is the process of identifying and eliminating errors, or "bugs," from software. While Erlang offers step-by-step debugging tools like the link:http://erlang.org/doc/apps/debugger/debugger_chapter.html[_Debugger_], the most effective debugging methods often rely on Erlang's tracing facilities. These facilities will be thoroughly discussed in Chapter xref:CH-Tracing[]. In this chapter We will touch on system level tracing witth dtrace and systemtap.
7+
Debugging is the process of identifying and eliminating errors, or "bugs," from software. While Erlang offers step-by-step debugging tools like the link:http://erlang.org/doc/apps/debugger/debugger_chapter.html[_Debugger_], the most effective debugging methods often rely on Erlang's tracing facilities. These facilities will be thoroughly discussed in Chapter xref:CH-Tracing[]. In this chapter We will touch on system level tracing with dtrace and systemtap.
88

99
This chapter also explores the concept of "Crash Dumps," which are human-readable text files generated by the Erlang Runtime System when an unrecoverable error occurs, such as running out of memory or reaching an emulator limit. Crash Dumps are invaluable for post-mortem analysis of Erlang nodes, and you will learn how to interpret and understand them.
1010

@@ -601,7 +601,7 @@ This dump suggests that the system crashed due to a memory allocation failure (`
601601
1. Slogan
602602
Indicates the reason for the crash. Common slogans include:
603603
- `eheap_alloc: Cannot allocate X bytes of memory` (Memory exhaustion)
604-
- `Init terminating in do_boot ()` (Pobably an erro in the boot script)
604+
- `Init terminating in do_boot ()` (Pobably an error in the boot script)
605605
- `Could not start kernel pid` (Probably a bad argument in config)
606606

607607
2. System Information

chapters/io.asciidoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ PortSettings)`.
270270
A file descriptor port is opened with `{fd, In, Out}` as the
271271
`PortName`. This class of ports is used by some internal ERTS servers
272272
like the old shell. They are considered to not be very efficient and
273-
hence seldom used. Also the filedescriptors are non negative intgers
273+
hence seldom used. Also the filedescriptors are non negative integers
274274
representing open file descriptors in the OS. The file descriptor can
275275
not be an erlang I/O server.
276276

@@ -389,7 +389,7 @@ By scheduling signals to/from the port asynchronously, Erlang ensures that proce
389389

390390
Now this means that the erlang send operation is not always asynchronous. If the port is busy the send operation will block until the port is not busy anymore. This is a problem if you have a lot of processes sending data to the same port. The solution is to use a port server that can handle the backpressure and make sure that the send operation is always asynchronous.
391391

392-
Let's do an example based on the offical port driver example:
392+
Let's do an example based on the official port driver example:
393393
link:https://www.erlang.org/doc/system/c_portdriver.html#c-driver[erlang.org:c-driver].
394394

395395
Let us use the original complex c function, adding 1 or multiplying by 2.
@@ -481,15 +481,15 @@ That also worked as expected: we sent 10 messages and got the results back in th
481481
```erlang
482482
5> busy_port:test_async_bar().
483483
Send: {bar,1}
484-
Shouldnt ! be async...
484+
Shouldn't ! be async...
485485
Send: {bar,2}
486-
Shouldnt ! be async...
486+
Shouldn't ! be async...
487487
Send: {bar,3}
488-
Shouldnt ! be async...
488+
Shouldn't ! be async...
489489
Send: {bar,4}
490-
Shouldnt ! be async...
490+
Shouldn't ! be async...
491491
Send: {bar,5}
492-
Shouldnt ! be async...
492+
Shouldn't ! be async...
493493
Send: {bar,6}
494494
Send: {bar,7}
495495
Send: {bar,8}

chapters/live.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
In this chapter we will look at how to run a live system in a
88
production environment and how to release your code for that system.
99

10-
In order to have reliable 24/7 server we need to beable to release new
10+
In order to have reliable 24/7 server we need to be able to release new
1111
features and bugfixes with as little disruption as possible to the
1212
running system. In this chapter we will learn about the tools provided
1313
by the runtime to handle releases.

chapters/processes.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ xref:erlang_process_memory_5[]:
13321332
+-------+ +-------+ +-------+ +-------+
13331333
----
13341334
1335-
The process dictionary is a very straighforward ((hash table))
1335+
The process dictionary is a very straightforward ((hash table))
13361336
implementation. In fact the PD memory area is just the plain bucket array,
13371337
and each slot is either ((`NIL`)) (the empty list) if the bucket is empty,
13381338
or otherwise it's a tagged pointer to data on the heap -- a simple tuple

chapters/profiling.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Takeaway: Although each call to factorial/1 is extremely fast, its high call cou
184184
===== cprof example
185185

186186
The cprof tool uses breakpoints to count calls, a lightweight approach
187-
that doesn't requre recompilation or any trace messages.
187+
that doesn't require recompilation or any trace messages.
188188
But you do not get a full call graph, nor do you get timing information.
189189

190190
[source,erlang]

chapters/type_system.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Note however that for longer term representation of large amounts of data,
358358
lists can use a lot of memory. Suppose you have a million small integers,
359359
each of which could be represented in 2 bytes. On a 64-bit Erlang system,
360360
representing this as a list `[1234, 2001, ...]` would use one million cons
361-
cells each holding a 64-bit immedate integer and a 64-bit pointer to the
361+
cells each holding a 64-bit immediate integer and a 64-bit pointer to the
362362
next cell in the list, i.e., 16 bytes per cell. That's 16 megabytes instead
363363
of 2. It would be more space-efficient to pack this data into a binary, but
364364
it all depends on how you need to access these numbers.

code/book/src/generate_op_doc.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ format_opcode(Opcode, Deprecated) ->
7171

7272

7373
strip(S) ->
74-
[ esacpe(Char)
74+
[ escape(Char)
7575
|| Char <- string:strip(S, right, 10)].
7676

77-
esacpe(Char) ->
77+
escape(Char) ->
7878
case Char of
7979
$| -> "\|";
8080
$\n -> " ";

0 commit comments

Comments
 (0)