

memok()                  General Function                 memok()




Test if the arena is corrupted

mmeemmookk();

The library  function memok  checks to see  if the area  has been
corrupted.  It returns one if the  arena is sound, and zero if it
has been corrupted.

***** Example *****

The   following  example   purposely  corrupts   the   arena,  to
demonstrate memok.   Please note that  this is not  a recommended
programming practice.


extern char *malloc();
main()
{
        char *p;



     p = malloc(2);           /* get 2 bytes of memory */
     printf("Arena is %s\n", memok() ? "OK" : "bad");
     strcpy(p, "too long");   /* clobber memory */
     printf("Arena is %s\n", memok() ? "OK" : "bad");
}


***** See Also *****

arena, calloc(), general functions, malloc(), realloc()
























COHERENT Lexicon                                           Page 1


