partition_segment_alloc.c 468 B

1234567891011121314151617
  1. /*
  2. * partition_segment_alloc.c
  3. */
  4. #include "private.h"
  5. /*-------------------------------------------------------- */
  6. void *lub_partition_segment_alloc(lub_partition_t * this, size_t * required)
  7. {
  8. if (*required < this->m_spec.min_segment_size) {
  9. *required = (this->m_spec.min_segment_size >> 1);
  10. }
  11. /* double the required size */
  12. *required <<= 1;
  13. return lub_partition_sysalloc(this, *required);
  14. }
  15. /*-------------------------------------------------------- */