}
buftext = BYTE_POS_ADDR (istart_byte);
+#ifdef REL_ALLOC
+ /* Prevent ralloc.c from relocating the current buffer while libxml2
+ functions below read its text. */
+ r_alloc_inhibit_buffer_relocation (1);
+#endif
if (htmlp)
doc = htmlReadMemory ((char *)buftext,
iend_byte - istart_byte, burl, "utf-8",
XML_PARSE_NONET|XML_PARSE_NOWARNING|
XML_PARSE_NOBLANKS |XML_PARSE_NOERROR);
+#ifdef REL_ALLOC
+ r_alloc_inhibit_buffer_relocation (0);
+#endif
/* If the assertion below fails, malloc was called inside the above
libxml2 functions, and ralloc.c caused relocation of buffer text,
so we could have read from unrelated memory. */