Guest User

Untitled

a guest
May 25th, 2018
1,712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. From 3b68e6668f11a7a02597149b1d410cf06b6fc88b Mon Sep 17 00:00:00 2001
  2. From: Florian Brosch <flo.brosch@gmail.com>
  3. Date: Tue, 17 Jan 2012 01:54:40 +0100
  4. Subject: [PATCH] glib-2.0: Move memory-functions to GLib.Memory
  5.  
  6. ---
  7. vapi/glib-2.0.vapi | 42 +++++++++++++++++++++++++++++++++++++++++-
  8. 1 files changed, 41 insertions(+), 1 deletions(-)
  9.  
  10. diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
  11. index a947553..4e2782d 100644
  12. --- a/vapi/glib-2.0.vapi
  13. +++ b/vapi/glib-2.0.vapi
  14. @@ -1364,7 +1364,7 @@ public class string {
  15. str_size = str.length;
  16. }
  17.  
  18. - string* result = GLib.malloc0 (this.length - (end - start) + str_size + 1);
  19. + string* result = GLib.Memory.alloc0 (this.length - (end - start) + str_size + 1);
  20.  
  21. char* dest = (char*) result;
  22.  
  23. @@ -1945,27 +1945,50 @@ namespace GLib {
  24.  
  25. /* Memory Allocation */
  26.  
  27. + [Deprecated (replacement = "Memory.alloc")]
  28. public static void* malloc (size_t n_bytes);
  29. + [Deprecated (replacement = "Memory.alloc0")]
  30. public static void* malloc0 (size_t n_bytes);
  31. + [Deprecated (replacement = "Memory.realloc")]
  32. public static void* realloc (void* mem, size_t n_bytes);
  33.  
  34. + [Deprecated (replacement = "Memory.try_alloc")]
  35. public static void* try_malloc (size_t n_bytes);
  36. + [Deprecated (replacement = "Memory.try_alloc0")]
  37. public static void* try_malloc0 (size_t n_bytes);
  38. + [Deprecated (replacement = "Memory.try_realloc")]
  39. public static void* try_realloc (void* mem, size_t n_bytes);
  40.  
  41. + [Deprecated (replacement = "Memory.free")]
  42. public static void free (void* mem);
  43.  
  44. + [Deprecated (replacement = "Memory.VTable")]
  45. public class MemVTable {
  46. }
  47.  
  48. + [Deprecated (replacement = "Memory.profiler_table")]
  49. [CCode (cname = "glib_mem_profiler_table")]
  50. public static MemVTable mem_profiler_table;
  51.  
  52. + [Deprecated (replacement = "Memory.set_vtable")]
  53. public static void mem_set_vtable (MemVTable vtable);
  54. + [Deprecated (replacement = "Memory.profile")]
  55. public static void mem_profile ();
  56.  
  57. [CCode (cheader_filename = "string.h")]
  58. namespace Memory {
  59. + [CCode (cname = "GMemVTable")]
  60. + public class VTable {
  61. + }
  62. +
  63. + [CCode (cname = "glib_mem_profiler_table")]
  64. + public static VTable profiler_table;
  65. + [CCode (cname = "g_mem_set_vtable")]
  66. + public static void set_vtable (VTable vtable);
  67. + [CCode (cname = "g_mem_profile")]
  68. + public static void profile ();
  69. +
  70. +
  71. [CCode (cname = "memcmp")]
  72. public static int cmp (void* s1, void* s2, size_t n);
  73. [CCode (cname = "memcpy")]
  74. @@ -1976,6 +1999,23 @@ namespace GLib {
  75. public static void* move (void* dest, void* src, size_t n);
  76. [CCode (cname = "g_memdup")]
  77. public static void* dup (void* mem, uint n);
  78. +
  79. + [CCode (cname = "g_malloc")]
  80. + public static void* alloc (size_t n_bytes);
  81. + [CCode (cname = "g_malloc0")]
  82. + public static void* alloc0 (size_t n_bytes);
  83. + [CCode (cname = "g_realloc")]
  84. + public static void* realloc (void* mem, size_t n_bytes);
  85. +
  86. + [CCode (cname = "g_try_malloc")]
  87. + public static void* try_alloc (size_t n_bytes);
  88. + [CCode (cname = "g_try_malloc0")]
  89. + public static void* try_alloc0 (size_t n_bytes);
  90. + [CCode (cname = "g_try_realloc")]
  91. + public static void* try_realloc (void* mem, size_t n_bytes);
  92. +
  93. + [CCode (cname = "g_free")]
  94. + public static void free (void* mem);
  95. }
  96.  
  97. namespace Slice {
  98. --
  99. 1.7.8.3
Add Comment
Please, Sign In to add comment