Commit graph

34 commits

Author SHA1 Message Date
George Koehler 1c8434e33a Switch led to malloc() and realloc().
Add USEMALLOC and enable it by default.  You can switch back to brk()
by removing `#define USEMALLOC` in memory.c.

USEMALLOC tells the allocator to use malloc() and realloc(), not
brk().  This might help systems where brk() doesn't work, or where
malloc() can allocate outside the brk area.

My build shows no changes in share/ack/examples (except hilo_bas.*).
2018-11-14 15:15:45 -05:00
George Koehler f09f14cd4d Switch from long to size_t when allocating memory.
Also move the declarations of `incore` and `core_alloc` to "memory.h".
Also correct SYMDEBUG to SYMDBUG.  (I don't know if SYMDBUG works
because our build system never defines it.)

ind_t becomes an alias of size_t.  ind_t becomes unsigned, so I edit
some code that was using negative ind_t.  Some casts disappear, like
(long)sizeof(...) because the size is already a size_t.  There are
changes to overflow checks.  Callers with a size too big for size_t
must check it before calling the memory allocator.  An overflow check
of BASE + incr in memory.c sbreak() now happens on all platforms, not
only when a pointer is smaller than a long.

My build shows no changes in share/ack/examples (except hilo_bas.*
changing with every build).
2018-11-14 12:33:25 -05:00
David Given 4cb4bdc85f There are two places where names are added to the global symbol table; one via
the -U command line option, and one via file scanning. Turns out only the
second would increment the number of global names, so adding names with -U
would cause names found via scanning to fall off the end of the list! This
wouldn't cause linker errors because fixups don't use the list, but would cause
the generated symbol table in the output to be incorrect.
2018-03-11 12:37:23 +01:00
George Koehler ca4bd38206 Delete old "assert.h" files; use libc <assert.h>.
Edit build.lua for programs losing their private assert.h, so they
depend on a list of .h files excluding assert.h.

Remove modules/src/assert; it would be a dependency of cpp.ansi but we
didn't build it, so cpp.ansi uses the libc assert.

I hope that libc <assert.h> can better report failed assertions.  Some
old "assert.h" files didn't report the expression.  Some reported a
literal "x", because traditional C expanded the macro parameter x in
"x", but ANSI C89 doesn't expand macro parameters in string literals.
2017-11-09 22:22:13 -05:00
David Given b83173734d More ansification. 2017-08-06 15:57:49 +02:00
David Given 60e7d06d82 Ansification and warning fixes. 2017-08-06 11:58:36 +02:00
David Given d5a83fd73e Clean up the led includes. 2017-01-18 19:55:56 +01:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
David Given a42939df50 LED builds now. 2016-08-14 14:40:01 +02:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel df1ed9426d Do not use '#endif/#else xxx'; it is not allowed for ANSI C 1991-12-17 15:28:58 +00:00
ceriel 6390348994 Changed print format 1990-12-14 13:57:46 +00:00
ceriel b3287b2b0f Some fixes: delinted and fixed alignment bug (bloody sizeof strikes again) 1990-12-11 11:10:46 +00:00
ceriel 1168708cd0 Added support for S_CRS 1990-07-30 11:56:28 +00:00
ceriel 218b982231 open and close output file in one place 1990-01-29 12:40:43 +00:00
ceriel 410a62e2de fixed some lint complaints 1989-11-08 14:18:57 +00:00
ceriel fd4bda4865 made more portable 1988-04-21 18:53:31 +00:00
ceriel a58740c4ee some fixes 1988-01-11 18:24:34 +00:00
ceriel c9e52b65d4 some minor fixes, and one important 2/4 one in the sbreak function 1987-09-02 18:42:21 +00:00
ceriel c1ffb28416 improved the c-flag, and corrected a bug in the produced relocation info 1987-08-26 13:22:44 +00:00
ceriel 123bcfc5e2 fix + some more statistics 1987-08-11 15:31:09 +00:00
ceriel 0300bbf5cb adapted sizes somewhat, made facility to print memory statistics 1987-08-11 14:42:15 +00:00
ceriel 6ac092bf38 core_alloc changed to old one 1987-05-21 10:10:27 +00:00
ceriel 4caf71f5b5 Some changes to handle more on small machines:
a section is now split into parts that fit in core
1987-05-21 10:06:14 +00:00
ceriel 0177bf59ff Bug fixes and made faster on PDP-11 1987-04-08 17:15:30 +00:00
ceriel 395b1bc424 Changed strategy somewhat 1987-04-01 08:20:39 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 24b7ad602a Improved compactification code. It was much to persistent, and
also too greedy. This causes long LONG linking times.
The current version is less greedy, but also gives up more
easily. Linking times are acceptable now.
1986-12-03 13:06:48 +00:00
ceriel 3e4629b077 made to work on small machines. 1986-12-02 16:16:08 +00:00
ceriel baf5b74da2 A new version, that no longer tries to move all null parts to the end
of a segment. It also uses the "object" library to read and write ACK-
object files and libraries.
1986-10-20 10:17:57 +00:00
keie 44ccf469d9 Changed to get led working under amoeba.
Author: K.S. Mullender.
1985-06-10 10:48:49 +00:00
keie b391be598b Now using arch.h, out.h and ranlib.h from ../../h 1985-04-18 15:21:16 +00:00
duk d7fb9edfe2 Maybe some minor changes. 1985-01-10 13:35:39 +00:00
duk f532b58045 Added provisions for copying everything after the string area into the
resulting object file. Because this is most likely symbolic debugging
information, these are parametrized by #ifdef SYMDBUG.
1985-01-08 11:54:57 +00:00