skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

genalloc_deepfree.c (274B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/stralloc.h>
      4 #include <skalibs/genalloc.h>
      5 
      6 void genalloc_deepfree_size (genalloc *g, free_func_ref f, size_t size)
      7 {
      8   size_t len = g->len / size ;
      9   size_t i = 0 ;
     10   for (; i < len ; i++) (*f)(g->s + i * size) ;
     11   stralloc_free(g) ;
     12 }