Skip to content

Commit c78ba61

Browse files
authored
Merge pull request #935 from HParker/unalloc-default-alloc
Remove alloc from defined classes
2 parents 82d8637 + 849cbd3 commit c78ba61

15 files changed

+28
-2
lines changed

ext/rugged/rugged_blame.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ static VALUE rb_git_blame_each(VALUE self)
264264
void Init_rugged_blame(void)
265265
{
266266
rb_cRuggedBlame = rb_define_class_under(rb_mRugged, "Blame", rb_cObject);
267+
rb_undef_alloc_func(rb_cRuggedBlame);
268+
267269
rb_include_module(rb_cRuggedBlame, rb_mEnumerable);
268270

269271
rb_define_singleton_method(rb_cRuggedBlame, "new", rb_git_blame_new, -1);

ext/rugged/rugged_blob.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ void Init_rugged_blob(void)
694694
id_read = rb_intern("read");
695695

696696
rb_cRuggedBlob = rb_define_class_under(rb_mRugged, "Blob", rb_cRuggedObject);
697+
rb_undef_alloc_func(rb_cRuggedBlob);
697698

698699
rb_define_method(rb_cRuggedBlob, "size", rb_git_blob_rawsize, 0);
699700
rb_define_method(rb_cRuggedBlob, "content", rb_git_blob_content_GET, -1);
@@ -712,6 +713,8 @@ void Init_rugged_blob(void)
712713
rb_define_singleton_method(rb_cRuggedBlob, "merge_files", rb_git_blob_merge_files, -1);
713714

714715
rb_cRuggedBlobSig = rb_define_class_under(rb_cRuggedBlob, "HashSignature", rb_cObject);
716+
rb_undef_alloc_func(rb_cRuggedBlobSig);
717+
715718
rb_define_singleton_method(rb_cRuggedBlobSig, "new", rb_git_blob_sig_new, -1);
716719
rb_define_singleton_method(rb_cRuggedBlobSig, "compare", rb_git_blob_sig_compare, 2);
717720
}

ext/rugged/rugged_commit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ static VALUE rb_git_commit_create_with_signature(int argc, VALUE *argv, VALUE se
869869
void Init_rugged_commit(void)
870870
{
871871
rb_cRuggedCommit = rb_define_class_under(rb_mRugged, "Commit", rb_cRuggedObject);
872+
rb_undef_alloc_func(rb_cRuggedCommit);
872873

873874
rb_define_singleton_method(rb_cRuggedCommit, "create", rb_git_commit_create, 2);
874875
rb_define_singleton_method(rb_cRuggedCommit, "create_to_s", rb_git_commit_create_to_s, 2);

ext/rugged/rugged_config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ void Init_rugged_config(void)
411411
* Config
412412
*/
413413
rb_cRuggedConfig = rb_define_class_under(rb_mRugged, "Config", rb_cObject);
414+
rb_undef_alloc_func(rb_cRuggedConfig);
415+
414416
rb_define_singleton_method(rb_cRuggedConfig, "new", rb_git_config_new, 1);
415417

416418
rb_define_singleton_method(rb_cRuggedConfig, "global", rb_git_config_open_default, 0);

ext/rugged/rugged_diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ static VALUE rb_git_diff_sorted_icase_p(VALUE self)
640640
void Init_rugged_diff(void)
641641
{
642642
rb_cRuggedDiff = rb_define_class_under(rb_mRugged, "Diff", rb_cObject);
643+
rb_undef_alloc_func(rb_cRuggedDiff);
643644

644645
rb_define_method(rb_cRuggedDiff, "patch", rb_git_diff_patch, -1);
645646
rb_define_method(rb_cRuggedDiff, "write_patch", rb_git_diff_write_patch, -1);

ext/rugged/rugged_index.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ void Init_rugged_index(void)
10291029
* Index
10301030
*/
10311031
rb_cRuggedIndex = rb_define_class_under(rb_mRugged, "Index", rb_cObject);
1032+
rb_undef_alloc_func(rb_cRuggedIndex);
1033+
10321034
rb_define_singleton_method(rb_cRuggedIndex, "new", rb_git_index_new, -1);
10331035

10341036
rb_define_method(rb_cRuggedIndex, "count", rb_git_index_count, 0);

ext/rugged/rugged_patch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ static VALUE rb_git_diff_patch_header(VALUE self)
383383
void Init_rugged_patch(void)
384384
{
385385
rb_cRuggedPatch = rb_define_class_under(rb_mRugged, "Patch", rb_cObject);
386+
rb_undef_alloc_func(rb_cRuggedPatch);
386387

387388
rb_define_singleton_method(rb_cRuggedPatch, "from_strings", rb_git_patch_from_strings, -1);
388389

ext/rugged/rugged_rebase.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ static VALUE rebase_operation_type(git_rebase_operation *operation)
389389
void Init_rugged_rebase(void)
390390
{
391391
rb_cRuggedRebase = rb_define_class_under(rb_mRugged, "Rebase", rb_cObject);
392+
rb_undef_alloc_func(rb_cRuggedRebase);
392393

393394
rb_define_singleton_method(rb_cRuggedRebase, "new", rb_git_rebase_new, -1);
394395
rb_define_method(rb_cRuggedRebase, "next", rb_git_rebase_next, 0);

ext/rugged/rugged_reference.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ static VALUE rb_git_ref_is_tag(VALUE self)
368368
void Init_rugged_reference(void)
369369
{
370370
rb_cRuggedReference = rb_define_class_under(rb_mRugged, "Reference", rb_cObject);
371+
rb_undef_alloc_func(rb_cRuggedReference);
371372

372373
rb_define_singleton_method(rb_cRuggedReference, "valid_name?", rb_git_ref_valid_name, 1);
373374

ext/rugged/rugged_remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
743743
void Init_rugged_remote(void)
744744
{
745745
rb_cRuggedRemote = rb_define_class_under(rb_mRugged, "Remote", rb_cObject);
746+
rb_undef_alloc_func(rb_cRuggedRemote);
746747

747748
rb_define_method(rb_cRuggedRemote, "name", rb_git_remote_name, 0);
748749
rb_define_method(rb_cRuggedRemote, "url", rb_git_remote_url, 0);

0 commit comments

Comments
 (0)