// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, (%rsp)
movb 0x20814(%rip), %al      # 0x336d8
testb %al, %al
je 0x12f84
movl %r15d, %ebx
negl %ebx
andl $0x7, %ebx
leaq (%rbx,%r15), %rdi
addq $0x40, %rdi
callq 0x185a6
movq %rax, %r14
testq %r15, %r15
je 0x12f11
xorl %ebp, %ebp
movq 0x200fe(%rip), %r12     # 0x32ff0
leaq 0xe6fb(%rip), %r13      # 0x215f4
movl $0x5, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x52e0
incq %rbp
cmpq %rbp, %r15
jne 0x12ef9
addq %r15, %rbx
movq %r14, %r12
addq %rbx, %r12
movq %r14, (%r12)
movq %r15, 0x8(%r12)
leaq 0x2078e(%rip), %rax     # 0x336b8
movq %rax, 0x10(%r12)
callq 0x8708
movq %rax, 0x18(%r12)
movq 0x10(%r12), %rax
leaq -0xa093(%rip), %rsi     # 0x8eb2
movq %r12, %rdi
callq *0x10(%rax)
movq (%rsp), %rbx
movq %r14, (%rbx)
leaq 0x8(%rbx), %r14
callq 0x8708
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7ce0
callq 0x8ede
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5bec
jmp 0x12ecc
movq %rax, %r15
movq $0x0, (%rbx)
movq %r14, %rdi
callq 0x186a4
jmp 0x12fd7
movq %rax, %rdi
callq 0x50e0
testq %rbp, %rbp
je 0x12fc2
xorl %ebx, %ebx
leaq (%r14,%rbx), %rdi
callq 0x19a50
incq %rbx
cmpq %rbx, %rbp
jne 0x12fb1
movq %r14, %rdi
callq 0x5310
callq 0x5370
movq %rax, %r15
callq 0x53d0
movq %r15, %rdi
callq 0x5430
movq %rax, %rdi
callq 0x90ea
nop