<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/tinyalloc, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/tinyalloc/atom?h=master</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/tinyalloc/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/'/>
<updated>2025-11-11T23:42:32+00:00</updated>
<entry>
<title>Fix buffer overflow on ta_realloc</title>
<updated>2025-11-11T23:42:32+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-11-11T23:42:32+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=e32da5559962c6131e1f933a245526d699d45cf6'/>
<id>urn:sha1:e32da5559962c6131e1f933a245526d699d45cf6</id>
<content type='text'>
When reallocating a buffer to one with a smaller size, the number of
elements to be copied to the new buffer must not be that of the old
buffer, or the behaviour is undefined.
</content>
</entry>
<entry>
<title>Do not resize blocks on realloc</title>
<updated>2025-11-11T23:37:51+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-11-11T23:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=07bff5530cf22d95b98139063ab50cabb8cabe76'/>
<id>urn:sha1:07bff5530cf22d95b98139063ab50cabb8cabe76</id>
<content type='text'>
This allocator was not designed for reallocations, and therefore
prev-&gt;size cannot be extended because that would overlap its contents
with other data.

Because of this, the only safe way to achieve a reallocation is to
always allocate a new block, copy any existing data and free the old
block.
</content>
</entry>
<entry>
<title>Redesign with sbrk(2)</title>
<updated>2025-11-10T22:50:41+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-11-10T22:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=fd8128d9b84e362abdbd05fafe252421edee8ab2'/>
<id>urn:sha1:fd8128d9b84e362abdbd05fafe252421edee8ab2</id>
<content type='text'>
So far, tinyalloc was designed for a static heap area, failing to
allocate whenever the end boundary was reached.

Unfortunately, this design was too limiting if the same library were to
be used for WebAssembly applications, where interpreters are required to
implement the current_memory and grow_memory operators. [1]

Whereas the former returns the number of currently allocated pages by
the interpreter (64 KiB being the standard page size), the latter must
increase that number by the number of pages required by the caller, but
without exceeding the maximum limit imposed by the application
developer.

Since WebAssembly's grow_memory is usually converted to sbrk(2) by
implementations, tinyalloc now makes use of this traditional syscall to
achieve the desired effect.

[1]: https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefsyntax-instr-memorymathsfmemorygrow
</content>
</entry>
<entry>
<title>Avoid undefined behaviour on const cast</title>
<updated>2025-07-25T22:27:57+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-07-12T15:06:32+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=96d060679a4c34c30a346f1945f88cb8ef45f657'/>
<id>urn:sha1:96d060679a4c34c30a346f1945f88cb8ef45f657</id>
<content type='text'>
Removing the const qualifier from a const-qualified object and modify it
is undefined behaviour.
</content>
</entry>
<entry>
<title>Avoid depending on stdint.h</title>
<updated>2025-07-25T22:27:57+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-07-12T15:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=20c7a57ce7900710787ec04322735eebcb1c5e6e'/>
<id>urn:sha1:20c7a57ce7900710787ec04322735eebcb1c5e6e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement ta_realloc</title>
<updated>2025-07-25T22:27:56+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi92@disroot.org</email>
</author>
<published>2025-07-12T15:05:57+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=18194dbd09a81e2993cf03153e1d810aa8abe4cc'/>
<id>urn:sha1:18194dbd09a81e2993cf03153e1d810aa8abe4cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update README.md</title>
<updated>2021-10-08T20:40:36+00:00</updated>
<author>
<name>Karsten Schmidt</name>
<email>k@thi.ng</email>
</author>
<published>2021-10-08T20:40:36+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=b60fcd7a351dea8a51f3ec95b19fc0d0d2e4dcd9'/>
<id>urn:sha1:b60fcd7a351dea8a51f3ec95b19fc0d0d2e4dcd9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge pull request #9 from Ryzee119/patch-1</title>
<updated>2020-09-18T00:32:42+00:00</updated>
<author>
<name>Karsten Schmidt</name>
<email>k@postspectacular.com</email>
</author>
<published>2020-09-18T00:32:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=7273051682ee0b9235bd24b7544f9fe643a023f5'/>
<id>urn:sha1:7273051682ee0b9235bd24b7544f9fe643a023f5</id>
<content type='text'>
Allow inclusion in CPP projects</content>
</entry>
<entry>
<title>Allow inclusion in CPP projects</title>
<updated>2020-09-17T11:32:31+00:00</updated>
<author>
<name>Ryzee119</name>
<email>wendland@live.com.au</email>
</author>
<published>2020-09-17T11:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=0f1d708a84144cadb2d9462beedc66de1bb48c42'/>
<id>urn:sha1:0f1d708a84144cadb2d9462beedc66de1bb48c42</id>
<content type='text'>
Attempted to use in Arduino, but got linker errors.
This resolved the issue.</content>
</entry>
<entry>
<title>Merge pull request #6 from llucinat/fix-heap-init</title>
<updated>2020-08-06T10:10:09+00:00</updated>
<author>
<name>Karsten Schmidt</name>
<email>k@postspectacular.com</email>
</author>
<published>2020-08-06T10:10:09+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/tinyalloc/commit/?id=8241b04999909769bdbd0046c3a2200cfed72367'/>
<id>urn:sha1:8241b04999909769bdbd0046c3a2200cfed72367</id>
<content type='text'>
Fix heap initialization</content>
</entry>
</feed>
