[Groonga-commit] groonga/groonga [master] use free() instead of realloc(ptr, 0) on Mac OS X.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 1月 5日 (水) 12:43:11 JST


Kouhei Sutou	2011-01-05 03:43:11 +0000 (Wed, 05 Jan 2011)

  New Revision: 63ce95e555f0ebd87363a6ceb29359564451d791

  Log:
    use free() instead of realloc(ptr, 0) on Mac OS X.

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+2 -2)
===================================================================
--- lib/ctx.c    2011-01-05 03:38:59 +0000 (54afb85)
+++ lib/ctx.c    2011-01-05 03:43:11 +0000 (cb10590)
@@ -2142,10 +2142,10 @@ grn_realloc_default(grn_ctx *ctx, void *ptr, size_t size, const char* file, int
     if (!ptr) { return NULL; }
     grn_alloc_info_check(ptr);
     GRN_ADD_ALLOC_COUNT(-1);
-#if defined __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
     free(ptr);
     return NULL;
-#else /* __FreeBSD__ */
+#else /* defined(__FreeBSD__) || defined(__APPLE__) */
     res = realloc(ptr, size);
     if (res) {
       GRN_LOG(ctx, GRN_LOG_ALERT, "realloc(%p,%zu)=%p (%s:%d) <%d>", ptr, size, res, file, line, alloc_count);




Groonga-commit メーリングリストの案内
Back to archive index