mirror of
https://github.com/cameron314/concurrentqueue.git
synced 2026-01-18 06:11:16 +01:00
Merge pull request #267 from cboulay/capi_size_approx
Expose size_approx in C API
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -21,6 +21,8 @@ build/msvc12/obj/
|
||||
build/msvc11/*.log
|
||||
build/msvc11/obj/
|
||||
build/xcode/build/
|
||||
.idea/
|
||||
cmake-build*/
|
||||
tests/fuzztests/fuzztests.log
|
||||
benchmarks/benchmarks.log
|
||||
tests/CDSChecker/*.o
|
||||
|
||||
@@ -31,4 +31,9 @@ int moodycamel_cq_try_dequeue(MoodycamelCQHandle handle, MoodycamelValue* value)
|
||||
return reinterpret_cast<MoodycamelCQPtr>(handle)->try_dequeue(*value) ? 1 : 0;
|
||||
}
|
||||
|
||||
size_t moodycamel_cq_size_approx(MoodycamelCQHandle handle)
|
||||
{
|
||||
return reinterpret_cast<MoodycamelCQPtr>(handle)->size_approx();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -26,6 +28,7 @@ MOODYCAMEL_EXPORT int moodycamel_cq_create(MoodycamelCQHandle* handle);
|
||||
MOODYCAMEL_EXPORT int moodycamel_cq_destroy(MoodycamelCQHandle handle);
|
||||
MOODYCAMEL_EXPORT int moodycamel_cq_enqueue(MoodycamelCQHandle handle, MoodycamelValue value);
|
||||
MOODYCAMEL_EXPORT int moodycamel_cq_try_dequeue(MoodycamelCQHandle handle, MoodycamelValue* value);
|
||||
MOODYCAMEL_EXPORT size_t moodycamel_cq_size_approx(MoodycamelCQHandle handle);
|
||||
|
||||
MOODYCAMEL_EXPORT int moodycamel_bcq_create(MoodycamelBCQHandle* handle);
|
||||
MOODYCAMEL_EXPORT int moodycamel_bcq_destroy(MoodycamelBCQHandle handle);
|
||||
|
||||
Reference in New Issue
Block a user