Skip to content

Commit

Permalink
Merge pull request opencog#1473 from chenrui333/add-build-patch
Browse files Browse the repository at this point in the history
link-grammar: add build patch
  • Loading branch information
linas authored Jun 19, 2023
2 parents 0a55d08 + b6c6fb6 commit 9439c73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/java/build.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project basedir="." default="build" name="linkgrammar">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
Expand Down
6 changes: 5 additions & 1 deletion link-grammar/parse/extract-links.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
/*************************************************************************/

#include <limits.h> // INT_MAX
#ifdef __APPLE__
#include <malloc/malloc.h>
#else
#include <malloc.h> // malloc_trim
#endif
#include <math.h> // log2

#include "connectors.h"
Expand Down Expand Up @@ -294,7 +298,7 @@ void free_extractor(extractor_t * pex)

xfree((void *) pex, sizeof(extractor_t));

#if defined __GLIBC__
#if defined __GLIBC__ && defined HAVE_MALLOC_TRIM
// malloc_trim() is a gnu extension. An alternative would be
// to call madvise(MADV_DONTNEED) but this is more complicated.
if (trim) malloc_trim(0);
Expand Down
2 changes: 1 addition & 1 deletion link-grammar/resources.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int getrusage(int who, struct rusage *rusage);
/** Returns the CPU usage time, for this thread only, in seconds. */
static double current_usage_time(void)
{
#if !defined(_WIN32)
#if !defined(_WIN32) && !defined(__APPLE__)
struct rusage u;
getrusage (RUSAGE_THREAD, &u);
return (u.ru_utime.tv_sec + ((double) u.ru_utime.tv_usec) / 1000000.0);
Expand Down

0 comments on commit 9439c73

Please sign in to comment.