<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/shm.c, branch 1.7.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-01-23T08:52:42Z</updated>
<entry>
<title>shm: don’t check for __i386__ and __x86_64__ - there are other architectures out there</title>
<updated>2021-01-23T08:52:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-21T11:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0d07ee03f59cd179758751d5cd2cc6bfbfef7ff9'/>
<id>urn:sha1:0d07ee03f59cd179758751d5cd2cc6bfbfef7ff9</id>
<content type='text'>
Instead, check for __SIZEOF_POINTER__ == 8, since what we’re really
interested in is whether we have enough virtual address space or not.
</content>
</entry>
<entry>
<title>shm: unbreak build without memfd_create</title>
<updated>2021-01-23T08:52:40Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T14:20:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=db9dc7e90853208a28d48c8b52f4251118005007'/>
<id>urn:sha1:db9dc7e90853208a28d48c8b52f4251118005007</id>
<content type='text'>
New FreeBSD versions have memfd_create but other BSDs don't.

pgo/pgo.c:260:22: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        int mem_fd = memfd_create("foot-pgo-ptmx", MFD_CLOEXEC);
                     ^
pgo/pgo.c:260:52: error: use of undeclared identifier 'MFD_CLOEXEC'
        int mem_fd = memfd_create("foot-pgo-ptmx", MFD_CLOEXEC);
                                                   ^
shm.c:13:10: fatal error: 'linux/mman.h' file not found
 #include &lt;linux/mman.h&gt;
          ^~~~~~~~~~~~~~
shm.c:277:15: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING);
              ^
shm.c:277:60: error: use of undeclared identifier 'MFD_CLOEXEC'
    pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING);
                                                           ^
shm.c:277:74: error: use of undeclared identifier 'MFD_ALLOW_SEALING'
    pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING);
                                                                         ^
shm.c:339:15: error: use of undeclared identifier 'F_SEAL_GROW'
              F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) &lt; 0)
              ^
shm.c:339:29: error: use of undeclared identifier 'F_SEAL_SHRINK'
              F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) &lt; 0)
                            ^
shm.c:339:71: error: use of undeclared identifier 'F_SEAL_SEAL'
              F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) &lt; 0)
                                                                      ^
shm.c:338:24: error: use of undeclared identifier 'F_ADD_SEALS'
    if (fcntl(pool_fd, F_ADD_SEALS,
                       ^
</content>
</entry>
<entry>
<title>shm: disable fallocate optimization if not supported</title>
<updated>2021-01-23T08:52:40Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T15:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=013e3c2d8057842593abf72b174223d350382dbc'/>
<id>urn:sha1:013e3c2d8057842593abf72b174223d350382dbc</id>
<content type='text'>
shm.c:301:26: error: implicit declaration of function 'fallocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        can_punch_hole = fallocate(
                         ^
shm.c:302:22: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
            pool_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1) == 0;
                     ^
shm.c:302:45: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
            pool_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1) == 0;
                                            ^
shm.c:432:9: error: implicit declaration of function 'fallocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (fallocate(
        ^
shm.c:434:13: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
            ^
shm.c:434:36: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
                                   ^
shm.c:501:9: error: implicit declaration of function 'fallocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (fallocate(
        ^
shm.c:503:13: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
            ^
shm.c:503:36: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
                                   ^
shm.c:597:9: error: implicit declaration of function 'fallocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (fallocate(
        ^
shm.c:599:13: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
            ^
shm.c:599:36: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
            FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
                                   ^
</content>
</entry>
<entry>
<title>shm: silence -Wunused-function on i386</title>
<updated>2021-01-23T08:52:40Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T15:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e35e98ea94dd216dc0eb86c9199aa49997659b96'/>
<id>urn:sha1:e35e98ea94dd216dc0eb86c9199aa49997659b96</id>
<content type='text'>
shm.c:134:1: error: unused function 'page_size' [-Werror,-Wunused-function]
page_size(void)
^
</content>
</entry>
<entry>
<title>debug: rename assert() to xassert(), to avoid clashing with &lt;assert.h&gt;</title>
<updated>2021-01-16T20:16:00Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-16T20:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e56136ce1192d04a52b01ccb41284f0b7896430e'/>
<id>urn:sha1:e56136ce1192d04a52b01ccb41284f0b7896430e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Print stack trace on assert() failure or when calling fatal_error()</title>
<updated>2021-01-16T19:56:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-15T20:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9'/>
<id>urn:sha1:22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9</id>
<content type='text'>
Note: this uses the __sanitizer_print_stack_trace() function from the
AddressSanitizer runtime, so it only works when AddressSanitizer is
in use.
</content>
</entry>
<entry>
<title>shm: fix badly indented function return type</title>
<updated>2020-12-07T19:44:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-04T17:42:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=85cdc66ff2e11704ab33f27095681ec886f6d721'/>
<id>urn:sha1:85cdc66ff2e11704ab33f27095681ec886f6d721</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: MAP_UNINITIALIZED is a linux only mmap flag</title>
<updated>2020-10-10T09:29:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-10T09:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9e0fcb1c27cf5980e4f7fc280a2a33fa6c188355'/>
<id>urn:sha1:9e0fcb1c27cf5980e4f7fc280a2a33fa6c188355</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix some buggy comparisons relating to signed/unsigned types</title>
<updated>2020-08-25T18:39:17Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-25T18:39:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f3acfea81565edf38ca7546fe4a351126d04442a'/>
<id>urn:sha1:f3acfea81565edf38ca7546fe4a351126d04442a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Cast printf formatter %p arguments to void*</title>
<updated>2020-08-23T08:07:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-23T05:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e32c0d9bf698782353bbe9e4348617523af473bd'/>
<id>urn:sha1:e32c0d9bf698782353bbe9e4348617523af473bd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: don't even try to punch a memfd hole in 32-bit</title>
<updated>2020-08-11T15:22:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-11T15:22:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=732e181b1d360425cf1b4853158e266ad4f07384'/>
<id>urn:sha1:732e181b1d360425cf1b4853158e266ad4f07384</id>
<content type='text'>
This ensures we don't issue a warning if we fail, something that will
just confuse users, as SHM scrolling is disabled in 32-bit anyway.
</content>
</entry>
<entry>
<title>Convert most dynamic allocations to use functions from xmalloc.h</title>
<updated>2020-08-08T19:37:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-08T19:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a77958ba20c2b344be5e66e69e2f212a4bbf6b3'/>
<id>urn:sha1:7a77958ba20c2b344be5e66e69e2f212a4bbf6b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace GCC "unused" and "format" attributes with portable macros</title>
<updated>2020-08-07T19:42:34Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-07T19:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7eb70a453b4ea797d9e85017c6deab6a7bc903a6'/>
<id>urn:sha1:7eb70a453b4ea797d9e85017c6deab6a7bc903a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: re-write cell clipping to use pixman destination clipping</title>
<updated>2020-06-04T13:39:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-04T13:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8b320ed29630e75c058bbf368ea5e2e9a68d0143'/>
<id>urn:sha1:8b320ed29630e75c058bbf368ea5e2e9a68d0143</id>
<content type='text'>
Our home rolled clip-to-cell code was, obviously, not correct.

The original problem was that we couldn't use pixman clipping since we
have multiple threads writing to the same pixman image, and thus there
would be races between the threads setting clipping.

The fix is actually simple - just instantiate one pixman
image (referencing the same backing image data) for each rendering
thread.
</content>
</entry>
<entry>
<title>shm: #ifdef conditional code to measure total size of SHM allocations</title>
<updated>2020-04-18T10:24:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-18T10:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4f145bed33d1de87993f947cb7fad31130fc868f'/>
<id>urn:sha1:4f145bed33d1de87993f947cb7fad31130fc868f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: memfd seal failures are not fatal errors</title>
<updated>2020-04-03T18:14:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-03T18:14:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2081047432c58481592e3e8155017fbbdf6c1da'/>
<id>urn:sha1:a2081047432c58481592e3e8155017fbbdf6c1da</id>
<content type='text'>
</content>
</entry>
<entry>
<title>conf: max-shm-pool-size-mb=0 now disables SHM scrolling</title>
<updated>2020-03-26T17:04:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-26T17:04:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c4aaba6299b092cd8221fb6e8c301fe5bfd602a4'/>
<id>urn:sha1:c4aaba6299b092cd8221fb6e8c301fe5bfd602a4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: make max pool size user configurable (via a 'tweak' setting)</title>
<updated>2020-03-25T19:48:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T19:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0baa249d8b59007913dbf7db8aa8d94e6c2b9d44'/>
<id>urn:sha1:0baa249d8b59007913dbf7db8aa8d94e6c2b9d44</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: handle ftruncate failure</title>
<updated>2020-03-25T17:32:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T17:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e9f1638750db342fbf26fc9477a970ab2e3e439d'/>
<id>urn:sha1:e9f1638750db342fbf26fc9477a970ab2e3e439d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: seal the memfd</title>
<updated>2020-03-25T17:30:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T17:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dc42cc1d195a16683c45fc87eb2dc333087a90da'/>
<id>urn:sha1:dc42cc1d195a16683c45fc87eb2dc333087a90da</id>
<content type='text'>
This both prevents accidental resizing of the memfd, and allows the
Wayland server to optimze reads from the buffer - it no longer has to
setup SIGBUS handlers.
</content>
</entry>
</feed>
