1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1997, 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A#
endif /* not lint */ 1N/A * Correct for systems that return NULL when you allocate 0 bytes of memory. 1N/A * There are several places in DB where we allocate the number of bytes held 1N/A * by the key/data item, and it can be 0. Correct here so that malloc never 1N/A * returns a NULL for that reason (which behavior is permitted by ANSI). We 1N/A * could make these calls macros on non-Alpha architectures (that's where we 1N/A * saw the problem), but it's probably not worth the autoconf complexity. 1N/A * Correct for systems that don't set errno when malloc and friends fail. 1N/A * We wish to hold the whole sky, 1N/A * But we never will. 1N/A * The strdup(3) function for DB. 1N/A * PUBLIC: int __os_strdup __P((const char *, void *)); 1N/A * The calloc(3) function for DB. 1N/A * PUBLIC: int __os_calloc __P((size_t, size_t, void *)); 1N/A * The malloc(3) function for DB. 1N/A * PUBLIC: int __os_malloc __P((size_t, void *(*)(size_t), void *)); 1N/A /* Never allocate 0 bytes -- some C libraries don't like it. */ 1N/A /* Some C libraries don't correctly set errno when malloc(3) fails. */ 1N/A * The realloc(3) function for DB. 1N/A * PUBLIC: int __os_realloc __P((void *, size_t)); 1N/A /* If we haven't yet allocated anything yet, simply call malloc. */ 1N/A /* Never allocate 0 bytes -- some C libraries don't like it. */ 1N/A * Some C libraries don't correctly set errno when realloc(3) fails. 1N/A * Don't overwrite the original pointer, there are places in DB we 1N/A * try to continue after realloc fails. 1N/A * The free(3) function for DB. 1N/A * PUBLIC: void __os_free __P((void *, size_t)); 1N/A * The free(3) function for DB, freeing a string. 1N/A * PUBLIC: void __os_freestr __P((void *));