#define ALLOCATE_FIXED_TYPE(type, structtype, result) \
do { \
result = xnew(structtype); \
+ assert(result != NULL); \
INCREMENT_CONS_COUNTER(sizeof(structtype), #type); \
} while (0)
#define ALLOCATE_ATOMIC_FIXED_TYPE(type, structtype, result) \
do { \
result = xnew_atomic(structtype); \
+ assert(result != NULL); \
INCREMENT_CONS_COUNTER(sizeof(structtype), #type); \
} while (0)
Lisp_Object make_uninit_string(Bytecount length)
{
- Lisp_String *s;
+ Lisp_String *s = NULL;
#if !defined HAVE_BDWGC || !defined EF_USE_BDWGC
EMACS_INT fullsize = STRING_FULLSIZE(length);
#endif /* !BDWGC */
set_lheader_implementation(&s->lheader, &lrecord_string);
string_register_finaliser(s);
-#if defined HAVE_BDWGC && defined EF_USE_BDWGC
{
- Bufbyte *foo = xnew_atomic_array(Bufbyte, length+1);
- set_string_data(s, foo);
- }
+ Bufbyte *foo = NULL;
+#if defined HAVE_BDWGC && defined EF_USE_BDWGC
+ foo = xnew_atomic_array(Bufbyte, length+1);
+ assert(foo != NULL);
#else
- set_string_data(s, BIG_STRING_FULLSIZE_P(fullsize)
- ? xnew_atomic_array(Bufbyte, length + 1)
- : allocate_string_chars_struct(s, fullsize)->chars);
+ if (BIG_STRING_FULLSIZE_P(fullsize)) {
+ foo = xnew_atomic_array(Bufbyte, length + 1);
+ assert(foo != NULL);
+ } else {
+ foo = allocate_string_chars_struct(s, fullsize)->chars;
+ assert(foo != NULL);
+ }
#endif
-
+ set_string_data(s, foo);
+ }
set_string_length(s, length);
s->plist = Qnil;
#ifdef EF_USE_COMPRE