private final CustomAllocator getCustomAllocator(Class cls) {
		Object a = customAllocatorMap.get(cls);

		if (a != null) {
			return a == defaultAllocator ? null : (CustomAllocator) a;
		}

		Class superclass = cls.getSuperclass();

		if (superclass != null) {
			CustomAllocator alloc = getCustomAllocator(superclass);

			if (alloc != null) {
				customAllocatorMap.put(cls, alloc);
				return alloc;
			}
		}

		Class[] interfaces = cls.getInterfaces();

		for (int i = 0; i < interfaces.length; i++) {
			CustomAllocator alloc = getCustomAllocator(interfaces[i]);

			if (alloc != null) {
				customAllocatorMap.put(cls, alloc);
				return alloc;
			}
		}

		customAllocatorMap.put(cls, defaultAllocator);
		return null;
	}