[Groonga-commit] groonga/groonga at 5832620 [master] plugin: add grn_plugin_calloc()/GRN_PLUGIN_CALLOC()

Back to archive index

naoa null+****@clear*****
Sun Feb 7 03:18:07 JST 2016


naoa	2016-02-07 03:18:07 +0900 (Sun, 07 Feb 2016)

  New Revision: 583262019cc2c526fd1b09090928e0218febc398
  https://github.com/groonga/groonga/commit/583262019cc2c526fd1b09090928e0218febc398

  Merged 772f9c0: Merge pull request #472 from naoa/plugin-calloc

  Message:
    plugin: add grn_plugin_calloc()/GRN_PLUGIN_CALLOC()

  Modified files:
    include/groonga/plugin.h
    lib/plugin.c

  Modified: include/groonga/plugin.h (+5 -1)
===================================================================
--- include/groonga/plugin.h    2016-02-06 23:18:03 +0900 (394eecf)
+++ include/groonga/plugin.h    2016-02-07 03:18:07 +0900 (5707163)
@@ -62,10 +62,12 @@ GRN_PLUGIN_EXPORT grn_rc GRN_PLUGIN_FIN(grn_ctx *ctx);
 
 /*
   Don't call these functions directly. Use GRN_PLUGIN_MALLOC(),
-  GRN_PLUGIN_REALLOC() and GRN_PLUGIN_FREE() instead.
+  GRN_PLUGIN_CALLOC(), GRN_PLUGIN_REALLOC() and GRN_PLUGIN_FREE() instead.
  */
 GRN_API void *grn_plugin_malloc(grn_ctx *ctx, size_t size, const char *file,
                                 int line, const char *func);
+GRN_API void *grn_plugin_calloc(grn_ctx *ctx, size_t size, const char *file,
+                                int line, const char *func);
 GRN_API void *grn_plugin_realloc(grn_ctx *ctx, void *ptr, size_t size,
                                  const char *file, int line, const char *func);
 GRN_API void grn_plugin_free(grn_ctx *ctx, void *ptr, const char *file,
@@ -73,6 +75,8 @@ 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_CALLOC(ctx, size) \
+  grn_plugin_calloc((ctx), (size), __FILE__, __LINE__, __FUNCTION__)
 #define GRN_PLUGIN_REALLOC(ctx, ptr, size) \
   grn_plugin_realloc((ctx), (ptr), (size), __FILE__, __LINE__, __FUNCTION__)
 #define GRN_PLUGIN_FREE(ctx, ptr) \

  Modified: lib/plugin.c (+7 -0)
===================================================================
--- lib/plugin.c    2016-02-06 23:18:03 +0900 (d1840cd)
+++ lib/plugin.c    2016-02-07 03:18:07 +0900 (c4ce3a5)
@@ -1000,6 +1000,13 @@ grn_plugin_malloc(grn_ctx *ctx, size_t size, const char *file, int line,
 }
 
 void *
+grn_plugin_calloc(grn_ctx *ctx, size_t size, const char *file, int line,
+                  const char *func)
+{
+  return grn_calloc(ctx, size, file, line, func);
+}
+
+void *
 grn_plugin_realloc(grn_ctx *ctx, void *ptr, size_t size,
                    const char *file, int line, const char *func)
 {
-------------- next part --------------
HTML����������������������������...
Download 



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