diff options
-rw-r--r-- | CHANGELOG.txt | 5 | ||||
-rw-r--r-- | docs.html | 4 | ||||
-rw-r--r-- | zap/include/zap/mem.h | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d1fcadd..e7376b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +# 15.1 + +* mem: Implement; +* docs: Add example definition to mem; + # 15.0 * Add new module mth; @@ -132,7 +132,7 @@ <p class="date">November XXIII MMXXII</p> <p class="copyright">Copyright Gabriel Jensen</p> <p class="title">the Zap Algorithmics Interfaces</p> - <p class="edition">Edition XXI</p> + <p class="edition">Edition XXI<sub> amd. I</sub></p> <div class="line"></div> </div> <div class="chapter"> @@ -756,7 +756,7 @@ <div class="section"> <p class="sectionTitle" id="symbols_mem">mem</p> <div class="code"> - <p>typedef struct /* see below */ zap_mem;</p> + <p>typedef struct {void * ptr;zap_sz sz} zap_mem;</p> </div> <br /> <p>A structure type for holding information about memory blocks returned by <i>alloc</i>. It has the members <i>ptr</i> of the built-in type <i>void *</i> and <i>len</i> of the type <i>sz</i> (in that order).</p> diff --git a/zap/include/zap/mem.h b/zap/include/zap/mem.h index d32a910..8646d63 100644 --- a/zap/include/zap/mem.h +++ b/zap/include/zap/mem.h @@ -13,6 +13,11 @@ extern "C" { #endif +typedef struct { + void * ptr; + zap_sz sz; +} zap_mem; + __attribute__ ((hot,warn_unused_result)) zap_sz zap_memcnt( void const * ptr, zap_sz sz, zap_sz num, zap_bool (* fn)(void const *)); __attribute__ ((hot,nothrow)) zap_sz zap_memcp( void const * in, zap_sz num, void * out); __attribute__ ((hot,nothrow,warn_unused_result)) zap_bool zap_memeq( void const * lptr, zap_sz num, void const * rptr); |