Sha256: 59640e506042c1dbaf63f0880170948c0e9631f361664a86395f061720dd1c80

Contents?: true

Size: 1.38 KB

Versions: 27

Compression:

Stored size: 1.38 KB

Contents

#ifndef BACKEND_IO_URING_CONTEXT_H
#define BACKEND_IO_URING_CONTEXT_H

#include "ruby.h"

enum op_type {
  OP_NONE,
  OP_READ,
  OP_WRITEV,
  OP_WRITE,
  OP_RECV,
  OP_SEND,
  OP_SPLICE,
  OP_TIMEOUT,
  OP_POLL,
  OP_ACCEPT,
  OP_CONNECT,
  OP_CHAIN,
  OP_CLOSE
};

typedef struct op_context {
  struct op_context *prev;
  struct op_context *next;
  enum op_type      type: 16;
  unsigned int      ref_count : 16;
  int               id;
  int               result;
  VALUE             fiber;
  VALUE             resume_value;
  unsigned int      buffer_count;
  VALUE             buffer0;
  VALUE             *buffers;
} op_context_t;

typedef struct op_context_store {
  int           last_id;
  op_context_t  *available;
  op_context_t  *taken;
  int           available_count;
  int           taken_count;
} op_context_store_t;

const char *op_type_to_str(enum op_type type);

void context_store_initialize(op_context_store_t *store);
op_context_t *context_store_acquire(op_context_store_t *store, enum op_type type);
int context_store_release(op_context_store_t *store, op_context_t *ctx);
void context_store_free(op_context_store_t *store);
void context_store_mark_taken_buffers(op_context_store_t *store);
void context_attach_buffers(op_context_t *ctx, unsigned int count, VALUE *buffers);
void context_attach_buffers_v(op_context_t *ctx, unsigned int count, ...);

#endif /* BACKEND_IO_URING_CONTEXT_H */

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
polyphony-0.99 ext/polyphony/backend_io_uring_context.h
polyphony-0.98 ext/polyphony/backend_io_uring_context.h
polyphony-0.97 ext/polyphony/backend_io_uring_context.h
polyphony-0.96 ext/polyphony/backend_io_uring_context.h
polyphony-0.95 ext/polyphony/backend_io_uring_context.h
polyphony-0.94 ext/polyphony/backend_io_uring_context.h
polyphony-0.93 ext/polyphony/backend_io_uring_context.h
polyphony-0.92 ext/polyphony/backend_io_uring_context.h
polyphony-0.91 ext/polyphony/backend_io_uring_context.h
polyphony-0.90 ext/polyphony/backend_io_uring_context.h
polyphony-0.89 ext/polyphony/backend_io_uring_context.h
polyphony-0.87 ext/polyphony/backend_io_uring_context.h
polyphony-0.86 ext/polyphony/backend_io_uring_context.h
polyphony-0.85 ext/polyphony/backend_io_uring_context.h
polyphony-0.84.1 ext/polyphony/backend_io_uring_context.h
polyphony-0.84 ext/polyphony/backend_io_uring_context.h
polyphony-0.83 ext/polyphony/backend_io_uring_context.h
polyphony-0.82 ext/polyphony/backend_io_uring_context.h
polyphony-0.81.1 ext/polyphony/backend_io_uring_context.h
polyphony-0.81 ext/polyphony/backend_io_uring_context.h