rmagick 7.2.0 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  #define _RMAGICK_GVL_HPP_
3
3
 
4
4
  extern void rm_gvl_init(void);
5
- extern void rm_gvl_check_readable(const void *);
6
- extern void rm_gvl_check_writable(const void *);
7
- extern bool rm_gvl_in_use(const void *);
5
+ extern void rm_gvl_check_readable(VALUE);
6
+ extern void rm_gvl_check_writable(VALUE);
7
+ extern bool rm_gvl_in_use(VALUE);
8
8
 
9
9
  /**
10
10
  * A call to an ImageMagick function without the GVL, which a Fiber scheduler
@@ -17,11 +17,10 @@ public:
17
17
  rm_gvl_call(gvl_function_t *fp, void *args);
18
18
 
19
19
  rm_gvl_call &read(VALUE obj);
20
- rm_gvl_call &read(const void *ptr);
21
20
  rm_gvl_call &update(VALUE obj);
22
- rm_gvl_call &update(const void *ptr);
23
21
  rm_gvl_call &read_each(VALUE ary);
24
22
  rm_gvl_call &update_each(VALUE ary);
23
+ rm_gvl_call &hold(VALUE obj, bool changes = false);
25
24
  rm_gvl_call &release(ExceptionInfo *exception);
26
25
  rm_gvl_call &release(ImageInfo *info);
27
26
  rm_gvl_call &release(DrawInfo *draw_info);
@@ -36,10 +35,12 @@ public:
36
35
  rm_gvl_call &free_result();
37
36
  rm_gvl_call &keep_thread(bool keep = true);
38
37
  rm_gvl_call &cleanup(void (*release)(void *, intptr_t), void *ptr, intptr_t arg = 0);
39
- rm_gvl_call &restore(void (*release)(void *, intptr_t), void *ptr, intptr_t arg = 0, size_t size = 0);
40
38
 
41
39
  template <typename T> T run();
42
40
 
41
+ bool uses(VALUE obj, bool update) const;
42
+ void restore() const;
43
+
43
44
  private:
44
45
  enum ResultType { ResultIgnored, ResultImage, ResultMemory };
45
46
  enum { MaxObjects = 4, MaxCleanups = 4 };
@@ -47,7 +48,6 @@ private:
47
48
  typedef struct
48
49
  {
49
50
  VALUE obj;
50
- const void *ptr;
51
51
  bool update;
52
52
  bool each;
53
53
  } object_t;
@@ -57,7 +57,6 @@ private:
57
57
  void (*release)(void *, intptr_t);
58
58
  void *ptr;
59
59
  intptr_t arg;
60
- size_t size;
61
60
  bool restore;
62
61
  } cleanup_t;
63
62
 
@@ -70,9 +69,15 @@ private:
70
69
  ResultType result_type;
71
70
  bool keep;
72
71
 
73
- rm_gvl_call &add_object(VALUE obj, const void *ptr, bool update, bool each);
74
- rm_gvl_call &add_cleanup(void (*release)(void *, intptr_t), void *ptr, intptr_t arg, size_t size, bool restore);
72
+ rm_gvl_call &add_object(VALUE obj, bool update, bool each);
73
+ rm_gvl_call &add_cleanup(void (*release)(void *, intptr_t), void *ptr, intptr_t arg, bool restore);
74
+ template <typename F> bool any_object(bool update_only, F f) const;
75
75
  void *call(ResultType type);
76
+ void check_frozen_images(ResultType type);
77
+ void *call_body(ResultType type);
78
+ struct offload_frame *new_frame();
79
+ void *offload(ResultType type);
80
+ void check_images_idle(ResultType type);
76
81
  void *call_here(ResultType type);
77
82
  void unwind(ResultType type, void *result, bool abandoned = false);
78
83
  };