Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.7.1 #964

Merged
merged 5 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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