libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

zunsetup.c (500B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include "internals.h"
      3 
      4 
      5 void
      6 zunsetup(void)
      7 {
      8 	size_t i;
      9 	if (libzahl_set_up) {
     10 		libzahl_set_up = 0;
     11 #define X(x, s)\
     12 		free(x->chars);
     13 		LIST_TEMPS;
     14 #undef X
     15 		for (i = BITS_PER_CHAR; i--;)
     16 			free(libzahl_tmp_divmod_ds[i]->chars);
     17 
     18 		for (i = sizeof(libzahl_pool) / sizeof(*libzahl_pool); i--;) {
     19 			while (libzahl_pool_n[i]--)
     20 				free(libzahl_pool[i][libzahl_pool_n[i]]);
     21 			free(libzahl_pool[i]);
     22 		}
     23 
     24 		free(libzahl_temp_stack);
     25 	}
     26 }