1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Disable vmalloc by default; fix build on Cygwin

Vmalloc is incompatible with Cygwin, but the code to disable it on
Cygwin did not work properly, somehow causing the build to freeze
at a seemingly unrelated point (i.e., when iffe feature tests
attempt to write to sfstdout).

Vmalloc has wasted my time for the last time, so now it's getting
disabled by default even on development builds and you'll have to
pass -D_AST_vmalloc in CCFLAGS to enable it for testing purposes.

This commit has a few other build tweaks as well.

src/lib/libast/features/vmalloc:
- tst map_malloc: Remove no-op #if __CYGWIN__ block which was in
  the #else clause of another #if __CYGWIN__ block.
- Output block ('cat{'):
  - Instead of disabling vmalloc for certain systems, disable it
    unless _AST_vmalloc is defined.
  - To disable it, set _AST_std_malloc as well as _std_malloc, just
    to be sure.

src/lib/libast/vmalloc/malloc.c:
- Remove ineffective Cygwin special-casing.

src/lib/libcmd/vmstate.c:
- This is only useful for vmalloc, so do not pointlessly compile it
  if vmalloc is disabled.

src/lib/libast/man/vmalloc.3:
- Add deprecation notice.

Resolves: https://github.com/ksh93/ksh/issues/360
This commit is contained in:
Martijn Dekker 2021-12-05 19:00:11 +01:00
parent 6e1e9b738b
commit 6faf43791b
5 changed files with 21 additions and 12 deletions

View file

@ -66,6 +66,13 @@ vmalloc \- virtual memory allocation
.MW "Void_t* valloc(size_t size);"
.MW "int setregmax(int regmax);"
.fi
.SH DEPRECATION NOTICE
In the 2021 ksh 93u+m distribution, \fIvmalloc\fP(3) was deprecated for
being unstable and wasteful in comparison to \fImalloc\fP(3) implementations
that come with modern operating systems.
By default, the interfaces described here map to the OS's standard
\fImalloc\fP(3) implementation. \fIvmalloc\fP can be enabled at compile time
by passing \fB-D_AST_vmalloc\fP in \fBCCFLAGS\fP.
.SH DESCRIPTION
These functions for dynamic storage allocation work in
\fIregions\fP of memory.