Пример #1
0
void RAISE(int excode, const char *fmt, ...)
{
    va_list args;
    va_start(args, fmt);
    vsnprintf(xmsg_buffer, XMSG_BUFFER_SIZE, fmt, args);
    xraise(excode, xmsg_buffer);
    va_end(args);
}
Пример #2
0
rt_public void eif_xcopy(EIF_REFERENCE source, EIF_REFERENCE target)
{
    /* Copy 'source' into expanded object 'target' if 'source' is not void,
     * or raise a "Void assigned to expanded" exception.
     */

    if (source == (EIF_REFERENCE)  0)
        xraise(MTC EN_VEXP);			/* Void assigned to expanded */

    eif_std_ref_copy(source, target);
}
Пример #3
0
rt_public void run_idr_init (size_t idrf_size, int type)
{
	RT_GET_CONTEXT
	idrf_buffer_size = idrf_size;

	run_idr_read_func = run_idr_read;

		/* Because we might mark the first `n' bytes of the buffer (see above
		 * instruction), we need to make sure that we have enough allocated memory
		 * to read or store `idrf_buffer_size' bytes.
		 */
	if (-1 == idrf_create (&idrf, idrf_size + sizeof(int32)))
		eraise ("cannot allocate idrf", EN_MEM);

		/* Reset amount_read */
	amount_read = 0;

		/* When writting a storable we mark some space at the front of the buffer
		 * to store upon writting the size of block, so that only one write operation
		 * is performed */
	if (type) {
		idr_setpos (&idrf.i_encode, sizeof(int32));
	}

#ifdef EIF_64_BITS
	idr_ref_table_counter = 0;
	idr_ref_table = (struct htable*) eif_rt_xmalloc (sizeof (struct htable), C_T, GC_OFF);
	if (idr_ref_table == NULL) {
		eraise ("Cannot allocate 64-32 mapping table", EN_MEM);
		xraise (EN_MEM);
	} else {
		if (ht_create (idr_ref_table, 10000, sizeof(rt_uint_ptr)) == -1) {
			eraise ("Cannot create 64-32 mapping table", EN_MEM);
		}
	}
#endif
}
Пример #4
0
rt_public void enomem(void)
{
    xraise(0);
}
Пример #5
0
rt_public void eraise(int val, char *tag)		/* %%zs incoherent with other definitions (see except.c:132, garcol.c:3901, eif_malloc.c:3495 */
{
    xraise(val);
}