1
0

private.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "lub/types.h"
  2. #include "lub/partition.h"
  3. #include "lub/heap.h"
  4. #include "lub/size_fmt.h"
  5. struct _lub_partition
  6. {
  7. lub_heap_t *m_global_heap;
  8. lub_partition_spec_t m_spec;
  9. bool_t m_dying;
  10. size_t m_partition_ceiling;
  11. };
  12. lub_heap_t *
  13. lub_partition__get_local_heap(lub_partition_t *instance);
  14. void
  15. lub_partition__set_local_heap(lub_partition_t *instance,
  16. lub_heap_t *local_heap);
  17. void
  18. lub_partition_lock(lub_partition_t *instance);
  19. void
  20. lub_partition_unlock(lub_partition_t *instance);
  21. lub_heap_status_t
  22. lub_partition_global_realloc(lub_partition_t *instance,
  23. char **ptr,
  24. size_t size,
  25. lub_heap_align_t alignment);
  26. void *
  27. lub_partition_segment_alloc(lub_partition_t *instance,
  28. size_t *required);
  29. void
  30. lub_partition_destroy_local_heap(lub_partition_t *instance,
  31. lub_heap_t *local_heap);
  32. void
  33. lub_partition_time_to_die(lub_partition_t *instance);
  34. bool_t
  35. lub_partition_extend_memory(lub_partition_t *instance,
  36. size_t required);
  37. void
  38. lub_partition_destroy(lub_partition_t *instance);
  39. lub_heap_t *
  40. lub_partition_findcreate_local_heap(lub_partition_t *instance);
  41. void *
  42. lub_partition_sysalloc(lub_partition_t *instance,
  43. size_t required);
  44. void
  45. lub_partition_init(lub_partition_t *instance,
  46. const lub_partition_spec_t *spec);
  47. void
  48. lub_partition_fini(lub_partition_t *instance);