123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /*
- * Copyright 2011 Institute of Communication and Computer Systems (ICCS)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
- /**
- * \file search_algorithms.h
- * \author Ioannis Koutras (joko@microlab.ntua.gr)
- * \date September, 2011
- *
- * \brief Various search algorithms for linked list structures used on DMMLib.
- */
- #ifndef LINKED_LISTS_SEARCH_ALGORITHMS_H
- #define LINKED_LISTS_SEARCH_ALGORITHMS_H
- #include "dmm_config.h"
- #include "freelist/freelist_rb.h"
- /**
- * Perform a best-fit search on free lists for a block of a certain size
- *
- * \param raw_block The raw block whose fixed list should be accessed.
- * \param requested_size The desired size of the block.
- *
- * \return The pointer of the data part of the matched memory block.
- * \retval NULL No block was found.
- */
- block_header_t * best_fit_on_freelist(freelist_rb_t *raw_block, size_t requested_size);
- #ifdef GOOD_FIT
- /**
- * Perform a good-fit search on the free list
- *
- * \param raw_block The raw block whose fixed list should be accessed.
- * \param requested_size The desired size of the block.
- *
- * \return The pointer to the data part of the matched memory block.
- * \retval NULL No block was found.
- */
- block_header_t * good_fit_on_freelist(freelist_rb_t *raw_block, size_t requested_size);
- #endif /* GOOD_FIT */
- /**
- * Perform an exact-fit search on free lists for a block of a certain size
- *
- * \param raw_block The raw block whose fixed list should be accessed.
- * \param requested_size The desired size of the block.
- *
- * \return The pointer of the data part of the matched memory block.
- * \retval NULL No block was found.
- */
- block_header_t * exact_fit_on_freelist(freelist_rb_t *raw_block, size_t requested_size);
- /**
- * Perform a first-fit search on free lists for a block of a certain size
- *
- * \param raw_block The raw block whose fixed list should be accessed.
- * \param requested_size The desired size of the block.
- *
- * \return The pointer of the data part of the matched memory block.
- * \retval NULL No block was found.
- */
- block_header_t * first_fit_on_freelist(freelist_rb_t *raw_block, size_t requested_size);
- #endif /* LINKED_LISTS_SEARCH_ALGORITHMS_H */
|