NativeXml ReallocMem fail!Help Me!

Help
2009-08-14
2013-05-23
  • photon wang

    photon wang - 2009-08-14

    When Do LoadFromFile!
    procedure TNativeXml.LoadFromStream(Stream: TStream);
    var
      B: TsdBufferedReadStream;
    begin
      // Create buffer filter. Since we read from the original stream a buffer at a
      // time, this speeds up the reading process for disk-based files.
      B := TsdBufferedReadStream.Create(Stream, False);
    {
    constructor TsdBufferedReadStream.Create(AStream: TStream; Owned: boolean);
    begin
      inherited Create;
      FStream := AStream;
      FOwned := Owned;
      FMustCheck := True;
      FPage := -1; // Set to invalid number to force an update on first read
      ReallocMem(FBuffer, cMaxBufferSize);//Err in there.FBuffer is nil! ReallocMem fail.

    }

     
    • photon wang

      photon wang - 2009-08-14

      FastMM4Options.inc is default.
      Run Some times.
      ReallocMem(FBuffer, cMaxBufferSize);//Err in there.FBuffer is nil! ReallocMem fail.

       
      • Muetze1

        Muetze1 - 2009-08-14

        NIL as result is a defined return value of ReAllocMem() if you pass as size 0. So check your code and specially your cMaxBufferSize constant. Check if it zero or negative.

         

Log in to post a comment.