// File: dragazo[P]cpp-gc/./GarbageCollection.h
// Function: GC::ptr<alert_t []> GC::make<alert_t [], 0>(unsigned long)
[[nodiscard]]
	static ptr<T> make(std::size_t count)
	{
		// -- normalize T -- //

		// strip cv qualifiers and first extent to get element type
		typedef std::remove_cv_t<std::remove_extent_t<T>> element_type;

		// strip cv qualifiers and all extents to get scalar type
		typedef std::remove_cv_t<std::remove_all_extents_t<T>> scalar_type;

		// get the total number of scalar objects - we'll build the array in terms of scalar entities
		const std::size_t scalar_count = count * GC::full_extent<T>::value;

		// get the allocator
		typedef checked_aligned_allocator_for<scalar_type, info> allocator_t;

		// -- create the vtable -- //

		// use lambda to conveniently create the set of all router functions for type T
		auto router_set = [](info &handle, auto func) { for (std::size_t i = 0; i < handle.count; ++i) GC::route(reinterpret_cast<scalar_type*>(handle.obj)[i], func); };

		static const info_vtable _vtable(
			[](info &handle) { for (std::size_t i = 0; i < handle.count; ++i) reinterpret_cast<scalar_type*>(handle.obj)[i].~scalar_type(); },
			[](info &handle) { allocator_t::dealloc(handle.obj); },
			router_set,
			router_set
		);

		// -- create the buffer for the objects and their info object -- //

		// compute the size of the array
		std::size_t arr_sz = scalar_count * sizeof(scalar_type);

		// to make sure the info object is aligned, round this up to a multiple of alignof(info).
		// note: this is not necessary if the element type size is already a multiple of alignof(info).
		if constexpr ((sizeof(element_type) & (alignof(info) - 1)) != 0)
		{
			arr_sz = arr_sz + ((~arr_sz + 1) & (alignof(info) - 1));
		}

		// allocate the buffer space (owning)
		void *const buf = allocator_t::alloc(arr_sz + sizeof(info));
		
		// alias the two buffer partitions
		scalar_type *const obj = reinterpret_cast<scalar_type*>(buf);
		info        *const handle = reinterpret_cast<info*>(reinterpret_cast<char*>(buf) + arr_sz);

		// -- construct the objects -- //

		std::size_t constructed_count = 0; // number of successfully constructed objects

		// try to construct the objects
		try
		{
			for (std::size_t i = 0; i < scalar_count; ++i)
			{
				new (obj + i) scalar_type();
				++constructed_count; // inc constructed_count after each success
			}
		}
		// if that fails
		catch (...)
		{
			// destroy anything we successfully constructed
			for (std::size_t i = 0; i < constructed_count; ++i) (obj + i)->~scalar_type();

			// deallocate the buffer and rethrow whatever killed us
			allocator_t::dealloc(buf);
			throw;
		}

		// construct the info object
		new (handle) info(obj, scalar_count, &_vtable);
		
		// -- do the garbage collection aspects -- //

		// claim its children
		handle->route(GC::router_unroot);

		// create the ptr first - this roots obj
		ptr<T> res(reinterpret_cast<element_type*>(obj), handle, GC::bind_new_obj);

		// begin timed collection (if it's not already)
		GC::start_timed_collect();

		// return the now-initialized ptr
		return res;
	}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
shlq $0x0, %rax
movq %rax, 0xa0(%rsp)
cmpb $0x0, 0x74119(%rip)     # 0x9a778
jne 0x266e7
leaq 0x7410c(%rip), %rdi     # 0x9a778
callq 0x5540
cmpl $0x0, %eax
je 0x266e7
leaq 0x9e(%rsp), %rdi
callq 0x42e40
movq %rax, 0x18(%rsp)
leaq 0x9d(%rsp), %rdi
callq 0x42e50
movq %rax, 0x20(%rsp)
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x42e60
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
callq 0x42e70
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %rax, %r8
leaq 0x74084(%rip), %rdi     # 0x9a758
callq 0x39840
jmp 0x266db
leaq 0x74096(%rip), %rdi     # 0x9a778
callq 0x51d0
movq 0xa0(%rsp), %rax
shlq $0x0, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq 0x80(%rsp), %rcx
xorq $-0x1, %rcx
addq $0x1, %rcx
andq $0x7, %rcx
addq %rcx, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
addq $0x40, %rdi
callq 0x39890
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jae 0x26825
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rax
addq %rax, %rdi
callq 0x42e80
jmp 0x2678d
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x26766
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x73fb2(%rip), %rdi     # 0x9a778
callq 0x51c0
jmp 0x2690a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
movq 0x90(%rsp), %rdi
callq 0x5110
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x60(%rsp), %rax
jae 0x26827
movq 0x70(%rsp), %rdi
addq 0x50(%rsp), %rdi
callq 0x42ea0
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x267fa
jmp 0x2685d
movq 0x78(%rsp), %rdi
callq 0x39a70
jmp 0x26833
callq 0x5450
jmp 0x2691f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
callq 0x54b0
jmp 0x26858
jmp 0x2690a
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0xa0(%rsp), %rdx
leaq 0x73ee2(%rip), %rcx     # 0x9a758
callq 0x39950
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq -0x1db1c(%rip), %rsi    # 0x8d70
leaq 0x48(%rsp), %rdi
callq 0x9580
movq 0x8(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x9550
movq 0x30(%rsp), %rdi
movb $0x0, 0x47(%rsp)
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x42ed0
callq 0x8e10
jmp 0x268c5
movb $0x1, 0x47(%rsp)
testb $0x1, 0x47(%rsp)
jne 0x268fd
jmp 0x268f3
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
callq 0x269d0
jmp 0x2690a
movq 0x30(%rsp), %rdi
callq 0x269d0
movq 0x38(%rsp), %rax
addq $0xb8, %rsp
retq
movq 0x90(%rsp), %rdi
callq 0x5510
movq %rax, %rdi
callq 0x9480
nop