Skip to content

Commit

Permalink
Merge pull request #964 from libgit2/cmn/bump-17
Browse files Browse the repository at this point in the history
Update to 1.7.1
  • Loading branch information
carlosmn authored Sep 4, 2023
2 parents d4edb6d + e3e0d62 commit 0b10975
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 56 deletions.
54 changes: 0 additions & 54 deletions ext/rugged/rugged_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,11 @@ static void *rugged_gmalloc(size_t n, const char *file, int line)
return xmalloc(n);
}

static void *rugged_gcalloc(size_t nelem, size_t elsize, const char *file, int line)
{
return xcalloc(nelem, elsize);
}

static char *rugged_gstrdup(const char *str, const char *file, int line)
{
return ruby_strdup(str);
}

static char *rugged_gstrndup(const char *str, size_t n, const char *file, int line)
{
size_t len;
char *newstr;

len = strnlen(str, n);
if (len < n)
n = len;

newstr = xmalloc(n+1);
memcpy(newstr, str, n);
newstr[n] = '\0';

return newstr;
}

static char *rugged_gsubstrdup(const char *str, size_t n, const char *file, int line)
{
char *newstr;

newstr = xmalloc(n+1);
memcpy(newstr, str, n);
newstr[n] = '\0';

return newstr;
}

static void *rugged_grealloc(void *ptr, size_t size, const char *file, int line)
{
return xrealloc(ptr, size);
}

static void *rugged_greallocarray(void *ptr, size_t nelem, size_t elsize, const char *file, int line)
{
return xrealloc2(ptr, nelem, elsize);
}

static void *rugged_gmallocarray(size_t nelem, size_t elsize, const char *file, int line)
{
return xmalloc2(nelem, elsize);
}

static void rugged_gfree(void *ptr)
{
xfree(ptr);
Expand All @@ -75,14 +28,7 @@ void rugged_set_allocator(void)
git_allocator allocator;

allocator.gmalloc = rugged_gmalloc;
allocator.gcalloc = rugged_gcalloc;
allocator.gstrdup = rugged_gstrdup;
allocator.gstrndup = rugged_gstrndup;
allocator.gstrndup = rugged_gstrndup;
allocator.gsubstrdup = rugged_gsubstrdup;
allocator.grealloc = rugged_grealloc;
allocator.greallocarray = rugged_greallocarray;
allocator.gmallocarray = rugged_gmallocarray;
allocator.gfree = rugged_gfree;

git_libgit2_opts(GIT_OPT_SET_ALLOCATOR, &allocator);
Expand Down
2 changes: 1 addition & 1 deletion lib/rugged/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# For full terms see the included LICENSE file.

module Rugged
Version = VERSION = '1.5.0'
Version = VERSION = '1.7.1'
end
2 changes: 1 addition & 1 deletion vendor/libgit2
Submodule libgit2 updated 362 files

0 comments on commit 0b10975

Please sign in to comment.