浏览代码

* make use of AllocMem in fpc_dynarray_setlength

git-svn-id: trunk@46900 -
florian 4 年之前
父节点
当前提交
449cc8f152
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      rtl/inc/dynarr.inc

+ 1 - 2
rtl/inc/dynarr.inc

@@ -208,8 +208,7 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
           { do we have to allocate memory? }
           { do we have to allocate memory? }
           if dims[0] = 0 then
           if dims[0] = 0 then
             exit;
             exit;
-          getmem(newp,size);
-          fillchar(newp^,size,0);
+          newp:=AllocMem(size);
 {$ifndef VER3_0}
 {$ifndef VER3_0}
           { call int_InitializeArray for management operators }
           { call int_InitializeArray for management operators }
           if assigned(eletypemngd) and (PTypeKind(eletype)^ in [tkRecord, tkObject]) then
           if assigned(eletypemngd) and (PTypeKind(eletype)^ in [tkRecord, tkObject]) then