FACTOR = LOGBITS - 3; /* ld(BITS / 8) = ld(BITS) - ld(8) = ld(BITS) - 3 */
MSB = (LSB << MODMASK);
- BITMASKTAB = (wordptr) malloc((size_t) (BITS << FACTOR));
+ BITMASKTAB = (wordptr) xmalloc((size_t) (BITS << FACTOR));
if (BITMASKTAB == NULL) return(ErrCode_Null);
size = BitVector_Size(bits);
mask = BitVector_Mask(bits);
bytes = (size + BIT_VECTOR_HIDDEN_WORDS) << FACTOR;
- addr = (wordptr) malloc((size_t) bytes);
+ addr = (wordptr) xmalloc((size_t) bytes);
if (addr != NULL)
{
*addr++ = bits;
else
{
bytes = (newsize + BIT_VECTOR_HIDDEN_WORDS) << FACTOR;
- newaddr = (wordptr) malloc((size_t) bytes);
+ newaddr = (wordptr) xmalloc((size_t) bytes);
if (newaddr != NULL)
{
*newaddr++ = bits;
length = bits >> 2;
if (bits AND 0x0003) length++;
- string = (charptr) malloc((size_t) (length+1));
+ string = (charptr) xmalloc((size_t) (length+1));
if (string == NULL) return(NULL);
string += length;
*string = (N_char) '\0';
charptr string;
length = bits_(addr);
- string = (charptr) malloc((size_t) (length+1));
+ string = (charptr) xmalloc((size_t) (length+1));
if (string == NULL) return(NULL);
string += length;
*string = (N_char) '\0';
length = (N_word) (bits / 3.3); /* digits = bits * ln(2) / ln(10) */
length += 2; /* compensate for truncating & provide space for minus sign */
- result = (charptr) malloc((size_t) (length+1)); /* remember the '\0'! */
+ result = (charptr) xmalloc((size_t) (length+1)); /* remember the '\0'! */
if (result == NULL) return(NULL);
string = result;
sign = BitVector_Sign(addr);
}
}
else length = 1;
- string = (charptr) malloc((size_t) length);
+ string = (charptr) xmalloc((size_t) length);
if (string == NULL) return(NULL);
start = 0;
comma = FALSE;
/* provide translation for independence of endian-ness: */
*length = size << FACTOR;
- buffer = (charptr) malloc((size_t) ((*length)+1));
+ buffer = (charptr) xmalloc((size_t) ((*length)+1));
if (buffer == NULL) return(NULL);
target = buffer;
if (size > 0)
FACTOR = LOGBITS - 3; /* ld(BITS / 8) = ld(BITS) - ld(8) = ld(BITS) - 3 */
MSB = (LSB << MODMASK);
- BITMASKTAB = (wordptr) malloc((size_t) (BITS << FACTOR));
+ BITMASKTAB = (wordptr) xmalloc((size_t) (BITS << FACTOR));
if (BITMASKTAB == NULL) return(ErrCode_Null);
size = BitVector_Size(bits);
mask = BitVector_Mask(bits);
bytes = (size + BIT_VECTOR_HIDDEN_WORDS) << FACTOR;
- addr = (wordptr) malloc((size_t) bytes);
+ addr = (wordptr) xmalloc((size_t) bytes);
if (addr != NULL)
{
*addr++ = bits;
else
{
bytes = (newsize + BIT_VECTOR_HIDDEN_WORDS) << FACTOR;
- newaddr = (wordptr) malloc((size_t) bytes);
+ newaddr = (wordptr) xmalloc((size_t) bytes);
if (newaddr != NULL)
{
*newaddr++ = bits;
length = bits >> 2;
if (bits AND 0x0003) length++;
- string = (charptr) malloc((size_t) (length+1));
+ string = (charptr) xmalloc((size_t) (length+1));
if (string == NULL) return(NULL);
string += length;
*string = (N_char) '\0';
charptr string;
length = bits_(addr);
- string = (charptr) malloc((size_t) (length+1));
+ string = (charptr) xmalloc((size_t) (length+1));
if (string == NULL) return(NULL);
string += length;
*string = (N_char) '\0';
length = (N_word) (bits / 3.3); /* digits = bits * ln(2) / ln(10) */
length += 2; /* compensate for truncating & provide space for minus sign */
- result = (charptr) malloc((size_t) (length+1)); /* remember the '\0'! */
+ result = (charptr) xmalloc((size_t) (length+1)); /* remember the '\0'! */
if (result == NULL) return(NULL);
string = result;
sign = BitVector_Sign(addr);
}
}
else length = 1;
- string = (charptr) malloc((size_t) length);
+ string = (charptr) xmalloc((size_t) length);
if (string == NULL) return(NULL);
start = 0;
comma = FALSE;
/* provide translation for independence of endian-ness: */
*length = size << FACTOR;
- buffer = (charptr) malloc((size_t) ((*length)+1));
+ buffer = (charptr) xmalloc((size_t) ((*length)+1));
if (buffer == NULL) return(NULL);
target = buffer;
if (size > 0)