docs/glossary: Add definitions for "buffer" and "fragmentation".
@@ -16,6 +16,11 @@ Glossary
may also refer to "boardless" ports like
:term:`Unix port <MicroPython Unix port>`).
+ buffer
+ An object implementing a buffer protocol. The simplest examples of
+ buffers are `bytes` (read-only buffer) and `bytearray` (read-write
+ buffer).
+
callee-owned tuple
A tuple returned by some builtin function/method, containing data
which is valid for a limited time, usually until next call to the
@@ -59,6 +64,27 @@ Glossary
differently than CPython, while still aspiring to be a Python
language implementation.
+ fragmentation
+ Fragmentation is a phenomenon of any dynamic memory allocation
+ system when free memory is spread across a number of chunks,
+ so while total amount of free memory may be high, allocating
+ a contiguous chunk of memory is possible only within the size
+ of the largest free chunk. Note that fragmentation is not just
+ an issue of scripting languages or MicroPython in particular,
+ a C program performing dynamic allocation is subject to the
+ same issues. To understand a problem better, consider following
+ example: there're 4K of memory total, and application consecutively
+ allocates 1K chunks, numbered #0, #1, #2, #3. Then if application
+ frees chunks #1 and #3, there're total 2K of free memory. However,
+ it's possible to allocate a chunk with the maximum size of 1K only.
+ Measures to fight fragmentation include: 1) preallocation (static
+ allocation) and inplace operations; 2) compacting garbage
+ collection. Static allocation is a well-known technique oftentimes
+ used in C. Unlike many other scripting languages, Python provides
+ excelent capabilities for inplace operations on preallocated
+ buffers and objects, and MicroPython extends it even further.
+ Compacting garbage collection is however an open topic.
+
GPIO
General-purpose input/output. The simplest means to control
electrical signals. With GPIO, user can configure hardware
