knobs.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright Institute of Communication and Computer Systems (ICCS)
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. /**
  18. * @file knobs.h
  19. * @author Ioannis Koutras (joko@microlab.ntua.gr)
  20. * @date November 2012
  21. * @brief Basic knob structure
  22. */
  23. #ifndef KNOBS_H
  24. #define KNOBS_H
  25. #include <dmmlib/config.h>
  26. #include <dmmlib/dmmstats.h>
  27. /** The knobs structure of dmmlib. */
  28. typedef struct dmm_knobs_s {
  29. double sys_alloc_size; /**< The default size of the raw block. */
  30. #ifdef GOOD_FIT
  31. double fit_percentage; /**< The good-fit percentage. */
  32. #endif /* GOOD_FIT */
  33. #ifdef COALESCING_VARIABLE
  34. double max_coal_size; /**< Maximum allowed size to be coalesced. */
  35. #endif /* COALESCING_VARIABLE */
  36. #ifdef SPLITTING_VARIABLE
  37. double min_split_size; /**< Minimum allowed size to be split. */
  38. #endif /* SPLITTING_VARIABLE */
  39. } dmm_knobs_t;
  40. /** Sets the system allocator's knob structure. */
  41. uint32_t dmm_set_knobs(dmm_knobs_t *conf);
  42. /** Notifies dmmlib that an application cycle has been completed. */
  43. void dmm_notify_cycle(void);
  44. #endif /* KNOBS_H */