[Groonga-commit] groonga/groonga at 1b6f939 [master] Add GRN_PLUGIN_MALLOCN convenient API

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Apr 10 15:13:50 JST 2016


Kouhei Sutou	2016-04-10 15:13:50 +0900 (Sun, 10 Apr 2016)

  New Revision: 1b6f939e0b68f6ec7117c0fd5428a40ad865317c
  https://github.com/groonga/groonga/commit/1b6f939e0b68f6ec7117c0fd5428a40ad865317c

  Message:
    Add GRN_PLUGIN_MALLOCN convenient API

  Modified files:
    include/groonga/plugin.h

  Modified: include/groonga/plugin.h (+3 -0)
===================================================================
--- include/groonga/plugin.h    2016-04-10 15:08:58 +0900 (e7074f8)
+++ include/groonga/plugin.h    2016-04-10 15:13:50 +0900 (37fc11d)
@@ -75,6 +75,9 @@ GRN_API void grn_plugin_free(grn_ctx *ctx, void *ptr, const char *file,
 
 #define GRN_PLUGIN_MALLOC(ctx, size) \
   grn_plugin_malloc((ctx), (size), __FILE__, __LINE__, __FUNCTION__)
+#define GRN_PLUGIN_MALLOCN(ctx, type, n) \
+  ((type *)(grn_plugin_malloc((ctx), sizeof(type) * (n), \
+                              __FILE__, __LINE__, __FUNCTION__)))
 #define GRN_PLUGIN_CALLOC(ctx, size) \
   grn_plugin_calloc((ctx), (size), __FILE__, __LINE__, __FUNCTION__)
 #define GRN_PLUGIN_REALLOC(ctx, ptr, size) \
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index