erlang各种有用的函数包括一些有用nif封装,还有一些性能测试case。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
502 B

5 years ago
  1. #ifndef C_SRC_EPQUEUE_ITEM_H_
  2. #define C_SRC_EPQUEUE_ITEM_H_
  3. #include "erl_nif.h"
  4. #include <stdint.h>
  5. struct epqueue_data;
  6. struct queue_item
  7. {
  8. int32_t heap_index;
  9. uint64_t priority;
  10. ErlNifBinary data;
  11. };
  12. void epqueue_item_update_pos(void* ax, int32_t pos);
  13. bool epqueue_item_less(void* ax, void* bx);
  14. queue_item* epqueue_item_new(const epqueue_data* data, const ErlNifBinary& bin, uint64_t priority);
  15. void epqueue_item_free(ErlNifEnv* env, void* obj);
  16. #endif // C_SRC_EPQUEUE_ITEM_H_