// cl_register_typetag().

// General includes.
#include "cl_sysdep.h"

// Specification.
#include "cl_object.h"


// Implementation.

#include "cl_abort.h"

extern cl_heap_destructor_function cl_destructor_table [(int)cl_typetag_dynamic_end - (int)cl_typetag_dynamic_start];

void cl_register_typetag (int typetag, cl_heap_destructor_function destructor)
{
	var unsigned int index = typetag - (int)cl_typetag_dynamic_start;
	if (!(index < (int)cl_typetag_dynamic_end - (int)cl_typetag_dynamic_start))
		cl_abort();
	cl_destructor_table[index] = destructor;
}
