Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

DOM.Core.Elements.Set_Attribute memory leak

Đang mở
#21 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
api

Hướng nghiên cứu

Start by reproducing the loop in the XMLBug example and inspect the implementation of DOM.Core.Elements.Set_Attribute. Verify that repeatedly setting the same attribute does not create additional attribute objects or cause unbounded memory growth.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

package DOM.Core.Elements is
...
   procedure Set_Attribute
     (Elem : Element; Name : DOM_String; Value : DOM_String);
   --  Set the value of a specific attribute. The attribute is created if it
   --  doesn't exist yet.
       ^^^^^^^^^^^^^^^^

But the procedure creates a new attribute every time, even if it already exists.

with DOM.Core.Documents;
with DOM.Core.Elements;

procedure XMLBug is
   Imp : DOM.Core.DOM_Implementation;
   Doc : DOM.Core.Document;
   Root : DOM.Core.Element;
begin
   Doc := DOM.Core.Create_Document (Imp);
   Root := DOM.Core.Documents.Create_Element (Doc, "data");
   loop
      DOM.Core.Elements.Set_Attribute (Root, "bug", "memory leak");
   end loop;
end XMLBug;
Ngôn ngữ chính
Ada
Star
30
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AdaCore/xmlada

Tất cả issue của AdaCore/xmlada

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.