PiDP-8/I SoftwareCheck-in [4b64cfdc4c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Found malloc() in UNIX V7, so added that info to the CC8 manual's poin on "no malloc() in CC8".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cc8-octal-output
Files: files | file ages | folders
SHA3-256:4b64cfdc4cb286f5303f8d5239ccf66c982f00dc0a2776babb5081c71f3c191c
User & Date: tangent 2019-02-22 11:12:42
Context
2019-02-22
11:40
Fleshed out the discussion of malloc() in the CC8 manual, turning it into a new sub-section, "Fun Trivia: The History of malloc()". check-in: cb743198fd user: tangent tags: cc8-octal-output
11:12
Found malloc() in UNIX V7, so added that info to the CC8 manual's poin on "no malloc() in CC8". check-in: 4b64cfdc4c user: tangent tags: cc8-octal-output
2019-02-21
12:34
Updated ChangeLog check-in: a6371d4cad user: tangent tags: cc8-octal-output
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/cc8-manual.md.

1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517





1518
1519
1520
1521
1522
1523
1524
There is no `malloc()` in this C library and no space reserved for its
heap in [the user data field](#udf). Everything in a CC8 program is
statically-allocated, if you’re using stock C-level mechanisms. If your
program needs additional dynamically-allocated memory, you’ll need to
arrange access to it some other way, such as [via inline
assembly](#asm).

(Fun trivia: there was no `malloc()` in K&R C, either! An appendix in
the first edition of “[The C Programming Language”][krc] gave a function
called `alloc()` that worked in terms of the old Unix syscall
[`sbrk(2)`][sbrk]. Early parts of the book gave a trivial version of
`alloc()` that was implemented in terms of a static buffer declared at
the top of the program, which was made big enough for the program’s
needs.  Sounds a lot like the way CC8 operates, yes?)






[sbrk]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/brk.html


### <a id="vonn"></a>There Are No Storage Type Distinctions

It may surprise you to learn that literals are placed in the same field







|
|
|
|
|
|
|
>
>
>
>
>







1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
There is no `malloc()` in this C library and no space reserved for its
heap in [the user data field](#udf). Everything in a CC8 program is
statically-allocated, if you’re using stock C-level mechanisms. If your
program needs additional dynamically-allocated memory, you’ll need to
arrange access to it some other way, such as [via inline
assembly](#asm).

(Fun trivia: there is no “`malloc()`” in K&R C, either, at least as far
as the first edition of “[The C Programming Language”][krc] goes. Early
in the book they give a simple function called `alloc()` that just
divvied up a large static `char[]` array for its callers. Then in an
appendix, they give a smarter alternative based on the old Unix syscall
[`sbrk(2)`][sbrk]. The impression given is that memory allocation isn’t
part of the language, it’s part of the operating system, and different
implementations of C were expected to provide this facility in local
ways. In the roughly contemporaneous UNIX V7, there *is* a `malloc()`
implementation in its `libc` that works on the same basic principles,
though if K&R `alloc()` is the ancestor of V7 `malloc()`, there’s a long
evolutionary chain between them.)

[sbrk]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/brk.html


### <a id="vonn"></a>There Are No Storage Type Distinctions

It may surprise you to learn that literals are placed in the same field