12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * 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.
- *
- */
- #include <stdbool.h>
- #include "block_header.h"
- #include "linked_lists/add_block_in_order.h"
- #include "linked_lists/address_order.h"
- bool has_smaller_address(void* block, void* comparing_block);
- bool has_smaller_address(void* block, void* comparing_block) {
- if(block < comparing_block) {
- return true;
- } else {
- return false;
- }
- }
- #ifdef COUNT_HOPS
- void add_block_address_order(
- heap_t *heap,
- void **block,
- void **starting_node) {
- add_block_in_order(
- heap,
- block,
- starting_node,
- has_smaller_address);
- }
- #else /* COUNT_HOPS */
- void add_block_address_order(
- void **block,
- void **starting_node) {
- add_block_in_order(
- block,
- starting_node,
- has_smaller_address);
- }
- #endif /* COUNT_HOPS */
|