// File: /workspace/github_cpp_makefile_star2_O3/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 0x1faa2(%rip), %al      # 0x316d8
testb %al, %al
je 0x11cf6
movl %r15d, %ebx
negl %ebx
andl $0x7, %ebx
leaq (%rbx,%r15), %rdi
addq $0x40, %rdi
callq 0x1725a
movq %rax, %r14
testq %r15, %r15
je 0x11c83
xorl %ebp, %ebp
movq 0x1f38c(%rip), %r12     # 0x30ff0
leaq 0xe955(%rip), %r13      # 0x205c0
movl $0x5, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x42e0
incq %rbp
cmpq %rbp, %r15
jne 0x11c6b
addq %r15, %rbx
movq %r14, %r12
addq %rbx, %r12
movq %r14, (%r12)
movq %r15, 0x8(%r12)
leaq 0x1fa1c(%rip), %rax     # 0x316b8
movq %rax, 0x10(%r12)
callq 0x7668
movq %rax, 0x18(%r12)
movq 0x10(%r12), %rax
leaq -0x9ec1(%rip), %rsi     # 0x7df6
movq %r12, %rdi
callq *0x10(%rax)
movq (%rsp), %rbx
movq %r14, (%rbx)
leaq 0x8(%rbx), %r14
callq 0x7668
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6c4e
callq 0x7e22
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4bd4
jmp 0x11c3e
movq %rax, %r15
movq $0x0, (%rbx)
movq %r14, %rdi
callq 0x17352
jmp 0x11d49
movq %rax, %rdi
callq 0x40e0
testq %rbp, %rbp
je 0x11d34
xorl %ebx, %ebx
leaq (%r14,%rbx), %rdi
callq 0x186fa
incq %rbx
cmpq %rbx, %rbp
jne 0x11d23
movq %r14, %rdi
callq 0x4310
callq 0x4370
movq %rax, %r15
callq 0x43d0
movq %r15, %rdi
callq 0x4430
movq %rax, %rdi
callq 0x8024
nop