1
0
mirror of https://github.com/cc65/cc65.git synced 2025-04-19 15:37:21 +00:00

Merge pull request #2625 from polluks/posix_memalign

Added doc and some refs #2613
This commit is contained in:
Bob Andrews 2025-04-06 19:25:10 +02:00 committed by GitHub
commit 2b30b90cfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 37 additions and 10 deletions

View File

@ -310,9 +310,9 @@ the memory from $800 to $1FFF can be added to the heap by calling
ProDOS 8 requires for every open file a page-aligned 1 KB I/O buffer. By default
these buffers are allocated by the cc65 runtime system on the heap using
<tt/posix_memalign()/. While this is generally the best solution it means quite
some overhead for (especially rather small) cc65 programs which do open files
but don't make use of the heap otherwise.
<url url="funcref.html#posix_memalign" name="posix_memalign()">. While this is
generally the best solution it means quite some overhead for (especially rather
small) cc65 programs which do open files but don't make use of the heap otherwise.
The apple2 package comes with the alternative ProDOS 8 I/O buffer allocation
module <tt/apple2-iobuf-0800.o/ which uses the memory between &dollar;800 and

View File

@ -290,9 +290,9 @@ the memory from &dollar;800 to &dollar;1FFF can be added to the heap by calling
ProDOS 8 requires for every open file a page-aligned 1 KB I/O buffer. By default
these buffers are allocated by the cc65 runtime system on the heap using
<tt/posix_memalign()/. While this is generally the best solution it means quite
some overhead for (especially rather small) cc65 programs which do open files
but don't make use of the heap otherwise.
<url url="funcref.html#posix_memalign" name="posix_memalign()">. While this is
generally the best solution it means quite some overhead for (especially rather
small) cc65 programs which do open files but don't make use of the heap otherwise.
The apple2enh package comes with the alternative ProDOS 8 I/O buffer allocation
module <tt/apple2enh-iobuf-0800.o/ which uses the memory between &dollar;800 and

View File

@ -412,8 +412,9 @@ Please mind that ANTIC has memory alignment requirements for "player
missile graphics"-data, font data, display lists and screen memory. Creation
of a special linker configuration with appropriate aligned segments and
switching to that segment in the c-code is usually necessary. A more memory
hungry solution consists in using the "<tt/posix_memalign()/" function in
conjunction with copying your data to the allocated memory.
hungry solution consists in using the <url url="funcref.html#posix_memalign"
name="posix_memalign()"> function in conjunction with copying your data to the
allocated memory.
<sect1>Character mapping<p>

View File

@ -19,7 +19,7 @@ the native format.
chrcvt65 is a vector font converter. It is able to convert a "BGI Stroked
Font" to a compact TGI native vector font. See the function <url
url="funcref.html#tgi_load_vectorfont" name="tgi_load_vectorfont"> for usage.
url="tgi.html#tgi_load_vectorfont" name="tgi_load_vectorfont"> for usage.

View File

@ -738,7 +738,7 @@ communication, see also <tt>testcode/lib/ser-test.c</tt>.
<item><ref id="ltoa" name="ltoa">
<item><ref id="malloc" name="malloc">
<item><ref id="perror" name="perror">
<!-- <item><ref id="posix_memalign" name="posix_memalign"> -->
<item><ref id="posix_memalign" name="posix_memalign">
<!-- <item><ref id="putenv" name="putenv"> -->
<item><ref id="qsort" name="qsort">
<item><ref id="rand" name="rand">
@ -6223,6 +6223,32 @@ be used in presence of a prototype.
</quote>
<sect1>posix_memalign<label id="posix_memalign"><p>
<quote>
<descrip>
<tag/Function/Allocate aligned dynamic memory.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size);/
<tag/Description/Allocate a block of memory with the given "size", which is aligned to a
memory address that is a multiple of "alignment". "alignment" <em/must not/ be
zero, and <em/must/ be a power of two; otherwise, this function will return
EINVAL. The function returns ENOMEM if not enough memory is available
to satisfy the request. "memptr" must point to a variable; that variable
will return the address of the allocated memory. Use free() to release that
allocated block.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="free" name="free">
<tag/Example/None.
</descrip>
</quote>
<sect1>psg_delay<label id="psg_delay"><p>
<quote>