mono-api-utils.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <h2>Utility Methods</h2>
  2. <h3>Bitsets</h3>
  3. <p>MonoBitsets are a set of routines used to manipulate sets
  4. of bits.
  5. <h4><a name="api:mono_bitset_alloc_size">mono_bitset_alloc_size</a></h4>
  6. <h4><a name="api:mono_bitset_clear">mono_bitset_clear</a></h4>
  7. <h4><a name="api:mono_bitset_clear_all">mono_bitset_clear_all</a></h4>
  8. <h4><a name="api:mono_bitset_clone">mono_bitset_clone</a></h4>
  9. <h4><a name="api:mono_bitset_copyto">mono_bitset_copyto</a></h4>
  10. <h4><a name="api:mono_bitset_count">mono_bitset_count</a></h4>
  11. <h4><a name="api:mono_bitset_equal">mono_bitset_equal</a></h4>
  12. <h4><a name="api:mono_bitset_find_first">mono_bitset_find_first</a></h4>
  13. <h4><a name="api:mono_bitset_find_last">mono_bitset_find_last</a></h4>
  14. <h4><a name="api:mono_bitset_find_start">mono_bitset_find_start</a></h4>
  15. <h4><a name="api:mono_bitset_foreach">mono_bitset_foreach</a></h4>
  16. <h4><a name="api:mono_bitset_free">mono_bitset_free</a></h4>
  17. <h4><a name="api:mono_bitset_intersection">mono_bitset_intersection</a></h4>
  18. <h4><a name="api:mono_bitset_invert">mono_bitset_invert</a></h4>
  19. <h4><a name="api:mono_bitset_mem_new">mono_bitset_mem_new</a></h4>
  20. <h4><a name="api:mono_bitset_new">mono_bitset_new</a></h4>
  21. <h4><a name="api:mono_bitset_set">mono_bitset_set</a></h4>
  22. <h4><a name="api:mono_bitset_set_all">mono_bitset_set_all</a></h4>
  23. <h4><a name="api:mono_bitset_size">mono_bitset_size</a></h4>
  24. <h4><a name="api:mono_bitset_sub">mono_bitset_sub</a></h4>
  25. <h4><a name="api:mono_bitset_test">mono_bitset_test</a></h4>
  26. <h4><a name="api:mono_bitset_test_bulk">mono_bitset_test_bulk</a></h4>
  27. <h4><a name="api:mono_bitset_union">mono_bitset_union</a></h4>
  28. <h4><a name="api:mono_bitset_find_first_unset">mono_bitset_find_first_unset</a></h4>
  29. <h4><a name="api:mono_bitset_intersection_2">mono_bitset_intersection_2</a></h4>
  30. <h3>Hashtables</h3>
  31. <p><tt>GHashTable</tt> is used when you need to store object
  32. references into a hashtable, objects stored in a
  33. <tt>MonoGHashTable</tt> are properly tracked by the garbage
  34. collector.
  35. <p>The <tt>MonoGHashTable</tt> data type has the same API as
  36. the GLIB.
  37. <h4><a name="api:mono_g_hash_table_destroy">mono_g_hash_table_destroy</a></h4>
  38. <h4><a name="api:mono_g_hash_table_foreach">mono_g_hash_table_foreach</a></h4>
  39. <h4><a name="api:mono_g_hash_table_foreach_remove">mono_g_hash_table_foreach_remove</a></h4>
  40. <h4><a name="api:mono_g_hash_table_foreach_steal">mono_g_hash_table_foreach_steal</a></h4>
  41. <h4><a name="api:mono_g_hash_table_insert">mono_g_hash_table_insert</a></h4>
  42. <h4><a name="api:mono_g_hash_table_lookup">mono_g_hash_table_lookup</a></h4>
  43. <h4><a name="api:mono_g_hash_table_lookup_extended">mono_g_hash_table_lookup_extended</a></h4>
  44. <h4><a name="api:mono_g_hash_table_new">mono_g_hash_table_new</a></h4>
  45. <h4><a name="api:mono_g_hash_table_new_full">mono_g_hash_table_new_full</a></h4>
  46. <h4><a name="api:mono_g_hash_table_remap">mono_g_hash_table_remap</a></h4>
  47. <h4><a name="api:mono_g_hash_table_remove">mono_g_hash_table_remove</a></h4>
  48. <h4><a name="api:mono_g_hash_table_replace">mono_g_hash_table_replace</a></h4>
  49. <h4><a name="api:mono_g_hash_table_size">mono_g_hash_table_size</a></h4>
  50. <h4><a name="api:mono_g_hash_table_steal">mono_g_hash_table_steal</a></h4>
  51. <h3>Raw buffer</h3>
  52. <p>Raw buffers provide an abstraction to load segments of
  53. files into memory. If the operating system supports it, the
  54. files are not loaded, but are mapped into the address space of
  55. the process (On Unix, this is done using the <tt>mmap(2)</tt>
  56. system call).
  57. <h4><a name="api:mono_raw_buffer_load">mono_raw_buffer_load</a></h4>
  58. <h4><a name="api:mono_raw_buffer_update">mono_raw_buffer_update</a></h4>
  59. <h4><a name="api:mono_raw_buffer_free">mono_raw_buffer_free</a></h4>
  60. <h3>SHA1 Signatures</h3>
  61. <h4><a name="api:mono_sha1_init">mono_sha1_init</a></h4>
  62. <h4><a name="api:mono_sha1_update">mono_sha1_update</a></h4>
  63. <h4><a name="api:mono_sha1_get_digest_from_file">mono_sha1_get_digest_from_file</a></h4>
  64. <h4><a name="api:mono_sha1_get_digest">mono_sha1_get_digest</a></h4>
  65. <h4><a name="api:mono_sha1_final">mono_sha1_final</a></h4>
  66. <h3>MD5 Signatures</h3>
  67. <h4><a name="api:mono_md5_init">mono_md5_init</a></h4>
  68. <h4><a name="api:mono_md5_update">mono_md5_update</a></h4>
  69. <h4><a name="api:mono_md5_get_digest_from_file">mono_md5_get_digest_from_file</a></h4>
  70. <h4><a name="api:mono_md5_get_digest">mono_md5_get_digest</a></h4>
  71. <h4><a name="api:mono_md5_final">mono_md5_final</a></h4>
  72. <h4><a name="api:mono_digest_get_public_token">mono_digest_get_public_token</a></h4>
  73. <h3>Memory Pools</h3>
  74. <p>Memory pools are a convenient way of tracking memory
  75. allocations that are used for one specific task, they are also
  76. faster than using the standard memory allocation procedures,
  77. as they are designed to be used only by a single thread at a
  78. time.
  79. <p><tt>MonoMemPool</tt> objects are not thread safe, which
  80. means that you should not share the objects across multiple
  81. threads without providing proper locking around it (unlike
  82. <tt>malloc</tt> and <tt>free</tt> which are thread safe).
  83. <p>When a <tt>MonoMemPool</tt> is released with
  84. <tt>mono_mempool_destroy</tt> all of the of the memory
  85. allocated from that memory pool with
  86. <tt>mono_mempool_alloc</tt> and <tt>mono_mempool_alloc0</tt>
  87. is released.
  88. <h4><a name="api:mono_mempool_new">mono_mempool_new</a></h4>
  89. <h4><a name="api:mono_mempool_destroy">mono_mempool_destroy</a></h4>
  90. <h4><a name="api:mono_mempool_alloc">mono_mempool_alloc</a></h4>
  91. <h4><a name="api:mono_mempool_alloc0">mono_mempool_alloc0</a></h4>
  92. <h4><a name="api:mono_mempool_empty">mono_mempool_empty</a></h4>
  93. <h4><a name="api:mono_mempool_invalidate">mono_mempool_invalidate</a></h4>
  94. <h4><a name="api:mono_mempool_stats">mono_mempool_stats</a></h4>
  95. <h4><a name="api:mono_mempool_contains_addr">mono_mempool_contains_addr</a></h4>
  96. <h3>JIT utilities</h3>
  97. <h4><a name="api:mono_is_power_of_two">mono_is_power_of_two</a></h4>
  98. <h4><a name="api:mono_signbit_double">mono_signbit_double</a></h4>
  99. <h4><a name="api:mono_signbit_float">mono_signbit_float</a></h4>
  100. <h3>Disassembling Generated Code</h3>
  101. <p>Routines used to debug the JIT-produced code.
  102. <h4><a name="api:mono_disasm_code">mono_disasm_code</a></h4>
  103. <h4><a name="api:mono_disasm_code_one">mono_disasm_code_one</a></h4>
  104. <h4><a name="api:mono_disassemble_code">mono_disassemble_code</a></h4>
  105. <h3>Walking the Stack</h3>
  106. <h4><a name="api:mono_walk_stack">mono_walk_stack</a></h4>
  107. <h4><a name="api:mono_stack_walk_no_il">mono_stack_walk_no_il</a></h4>
  108. <h3>Others</h3>
  109. <h4><a name="api:mono_escape_uri_string">mono_escape_uri_string</a></h4>
  110. <h4><a name="api:mono_guid_to_string">mono_guid_to_string</a></h4>