aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/resource_quota.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/iomgr/resource_quota.h')
-rw-r--r--src/core/lib/iomgr/resource_quota.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index 1d4249b7e2..fcdf9c2de5 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -67,58 +67,58 @@ extern "C" {
extern grpc_tracer_flag grpc_resource_quota_trace;
-grpc_resource_quota *grpc_resource_quota_ref_internal(
- grpc_resource_quota *resource_quota);
-void grpc_resource_quota_unref_internal(grpc_exec_ctx *exec_ctx,
- grpc_resource_quota *resource_quota);
-grpc_resource_quota *grpc_resource_quota_from_channel_args(
- const grpc_channel_args *channel_args);
+grpc_resource_quota* grpc_resource_quota_ref_internal(
+ grpc_resource_quota* resource_quota);
+void grpc_resource_quota_unref_internal(grpc_exec_ctx* exec_ctx,
+ grpc_resource_quota* resource_quota);
+grpc_resource_quota* grpc_resource_quota_from_channel_args(
+ const grpc_channel_args* channel_args);
/* Return a number indicating current memory pressure:
0.0 ==> no memory usage
1.0 ==> maximum memory usage */
double grpc_resource_quota_get_memory_pressure(
- grpc_resource_quota *resource_quota);
+ grpc_resource_quota* resource_quota);
-size_t grpc_resource_quota_peek_size(grpc_resource_quota *resource_quota);
+size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota);
typedef struct grpc_resource_user grpc_resource_user;
-grpc_resource_user *grpc_resource_user_create(
- grpc_resource_quota *resource_quota, const char *name);
+grpc_resource_user* grpc_resource_user_create(
+ grpc_resource_quota* resource_quota, const char* name);
/* Returns a borrowed reference to the underlying resource quota for this
resource user. */
-grpc_resource_quota *grpc_resource_user_quota(
- grpc_resource_user *resource_user);
+grpc_resource_quota* grpc_resource_user_quota(
+ grpc_resource_user* resource_user);
-void grpc_resource_user_ref(grpc_resource_user *resource_user);
-void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user);
-void grpc_resource_user_shutdown(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user);
+void grpc_resource_user_ref(grpc_resource_user* resource_user);
+void grpc_resource_user_unref(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user);
+void grpc_resource_user_shutdown(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user);
/* Allocate from the resource user (and its quota).
If optional_on_done is NULL, then allocate immediately. This may push the
quota over-limit, at which point reclamation will kick in.
If optional_on_done is non-NULL, it will be scheduled when the allocation has
been granted by the quota. */
-void grpc_resource_user_alloc(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user, size_t size,
- grpc_closure *optional_on_done);
+void grpc_resource_user_alloc(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user, size_t size,
+ grpc_closure* optional_on_done);
/* Release memory back to the quota */
-void grpc_resource_user_free(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user, size_t size);
+void grpc_resource_user_free(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user, size_t size);
/* Post a memory reclaimer to the resource user. Only one benign and one
destructive reclaimer can be posted at once. When executed, the reclaimer
MUST call grpc_resource_user_finish_reclamation before it completes, to
return control to the resource quota. */
-void grpc_resource_user_post_reclaimer(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user,
- bool destructive, grpc_closure *closure);
+void grpc_resource_user_post_reclaimer(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user,
+ bool destructive, grpc_closure* closure);
/* Finish a reclamation step */
-void grpc_resource_user_finish_reclamation(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user);
+void grpc_resource_user_finish_reclamation(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user);
/* Helper to allocate slices from a resource user */
typedef struct grpc_resource_user_slice_allocator {
@@ -131,27 +131,27 @@ typedef struct grpc_resource_user_slice_allocator {
/* Number of slices to allocate on the current request */
size_t count;
/* Destination for slices to allocate on the current request */
- grpc_slice_buffer *dest;
+ grpc_slice_buffer* dest;
/* Parent resource user */
- grpc_resource_user *resource_user;
+ grpc_resource_user* resource_user;
} grpc_resource_user_slice_allocator;
/* Initialize a slice allocator.
When an allocation is completed, calls \a cb with arg \p. */
void grpc_resource_user_slice_allocator_init(
- grpc_resource_user_slice_allocator *slice_allocator,
- grpc_resource_user *resource_user, grpc_iomgr_cb_func cb, void *p);
+ grpc_resource_user_slice_allocator* slice_allocator,
+ grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p);
/* Allocate \a count slices of length \a length into \a dest. Only one request
can be outstanding at a time. */
void grpc_resource_user_alloc_slices(
- grpc_exec_ctx *exec_ctx,
- grpc_resource_user_slice_allocator *slice_allocator, size_t length,
- size_t count, grpc_slice_buffer *dest);
+ grpc_exec_ctx* exec_ctx,
+ grpc_resource_user_slice_allocator* slice_allocator, size_t length,
+ size_t count, grpc_slice_buffer* dest);
/* Allocate one slice of length \a size synchronously. */
-grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx,
- grpc_resource_user *resource_user,
+grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx* exec_ctx,
+ grpc_resource_user* resource_user,
size_t size);
#ifdef __cplusplus