+static compressor_slot_t *
+zalloc_slot_array(size_t size, zalloc_flags_t flags)
+{
+#if defined(__LP64__)
+ compressor_slot_t *slots = NULL;
+
+ assert(size <= COMPRESSOR_SLOTS_CHUNK_SIZE);
+ for (unsigned int idx = 0; idx < NUM_SLOTS_ZONES; idx++) {
+ if (size > compressor_slots_zones_sizes[idx]) {
+ continue;
+ }
+ slots = zalloc_flags(compressor_slots_zones[idx], flags);
+ break;
+ }
+ return slots;
+#else /* defined(__LP64__) */
+ return kheap_alloc(KHEAP_DATA_BUFFERS, size, flags);
+#endif /* !defined(__LP64__) */
+}
+
+static void
+zfree_slot_array(compressor_slot_t *slots, size_t size)
+{
+#if defined(__LP64__)
+ assert(size <= COMPRESSOR_SLOTS_CHUNK_SIZE);
+ for (unsigned int idx = 0; idx < NUM_SLOTS_ZONES; idx++) {
+ if (size > compressor_slots_zones_sizes[idx]) {
+ continue;
+ }
+ zfree(compressor_slots_zones[idx], slots);
+ break;
+ }
+#else /* defined(__LP64__) */
+ kheap_free(KHEAP_DATA_BUFFERS, slots, size);
+#endif /* !defined(__LP64__) */
+}
+