1 /* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef XBT_HEAP_PRIVATE_H
7 #define XBT_HEAP_PRIVATE_H
10 #include <xbt/dynar.h>
13 typedef struct xbt_heap_item {
16 } s_xbt_heap_item_t, *xbt_heap_item_t;
18 typedef struct xbt_heap {
21 s_xbt_heap_item_t* items; /* array of structs */
23 void (*update_callback) (void *, int);
26 #define PARENT(i) (i >> 1)
27 #define LEFT(i) (i << 1)
28 #define RIGHT(i) ((i << 1) + 1)
30 #define KEY(H,i) ((H->items)[i]).key
31 #define CONTENT(H,i) ((H->items)[i]).content
33 #define MIN_KEY_VALUE -DBL_MAX